# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 0
n 0(None)[return (GeneralConfigNotebookSubMenuParameters, dict(name=_('General'), type='notebook_setup_general'))
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa160b4c>}
nname: 0
n 0(None)[return (GeneralNotebookSubMenuParameters, dict(name=_('Video/Photo'), type='notebook_setup_videophoto'))
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa160fec>}
nname: 0
n 0(None)[return (ConnectionsNotebookSubMenuParameters, dict(name=_('Connection'), type='notebook_setup_connections'))
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa1601ac>}
nname: 0
n 0(None)[return (NetworkNotebookSubMenuParameters, dict(name=_('General'), type='notebook_setup_network'))
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa160b4c>}
nname: 0
n 0(None)[return (AdvancedNotebookSubMenuParameters, dict(name=_('Advanced'), type='notebook_setup_advanced'))
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa16006c>}
nname: 0
n 0(None)[return (VersionNotebookSubMenuParameters, dict(name=_('Version'), type='notebook_setup_version'))
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa160e0c>}
nname: 198
n 198(None)[return status
]:
	i: 150(), 164(), 196(AE)
	o: 

nname: 196
n 196(None)[]:
	i: 154(f)
	o: 198(AE)

nname: 164
n 164(None)[#, e
log.error('unable to get status from wynetwork')
PRINT_EXCEPTION(e)
]:
	i: 154(t)
	o: 198()

nname: 154
n 154(<dummy_ex3> EXC_MATCH Exception)[]:
	i: 0(except)
	o: 164(t), 196(f)

nname: 150
n 150(None)[]:
	i: 33(AL), 145(), 149()
	o: 198()

nname: 149
n 149(None)[]:
	i: 15(f)
	o: 150()

nname: 145
n 145(None)[]:
	i: 37(AF), 141()
	o: 150()

nname: 141
n 141(None)[]:
	i: 56(f), 134()
	o: 145()

nname: 134
n 134(None)[status = _('Ethernet network')
break
continue
]:
	i: 113(), 124()
	o: 141()

nname: 124
n 124(None)[]:
	i: 96(f)
	o: 134()

nname: 113
n 113(None)[]:
	i: 96(t)
	o: 134()

nname: 96
n 96(dev_infos['networkType'] == '802.11')[]:
	i: 56(t)
	o: 113(t), 124(f)

nname: 56
n 56(dev_infos['active'] == 'true')[for dev in self.wn.wn_dev.getDevices():
dev_infos = self.wn.wn_dev.getDeviceInfos(dev)
]:
	i: 37(for)
	o: 96(t), 141(f)

nname: 37
n 37(None)[]:
	i: 33(loop)
	o: 56(for), 145(AF)

nname: 33
n 33(None)[]:
	i: 15(t)
	o: 37(loop), 150(AL)

nname: 15
n 15(self.wn.wn_gen.isConnected())[]:
	i: 0(try)
	o: 33(t), 149(f)

nname: 0
n 0(None)[status = _('Disconnected')
]:
	i: 
	o: 15(try), 154(except)

nname: 198
n 198(None)[return status
]:
	i: 154(), 33(AL), 37(AF), 56(f), 96(), 0(f)
	o: 

nname: 154
n 154(None)[except Exception, e:
	log.error('unable to get status from wynetwork')
	PRINT_EXCEPTION(e)
]:
	i: 0()
	o: 198()

nname: 198
n 198(None)[return status
]:
	i: 154(), 33(AL), 37(AF), 56(f), 96(), 0(f)
	o: 

nname: 96
n 96(None)[if dev_infos['networkType'] == '802.11':
	pass
status = _('Ethernet network')
break
continue
]:
	i: 56(t)
	o: 198()

nname: 56
n 56(dev_infos['active'] == 'true')[for dev in self.wn.wn_dev.getDevices():
dev_infos = self.wn.wn_dev.getDeviceInfos(dev)
]:
	i: 37(for)
	o: 96(t), 198(f)

nname: 37
n 37(None)[]:
	i: 33(loop)
	o: 56(for), 198(AF)

nname: 33
n 33(None)[]:
	i: 0(t)
	o: 37(loop), 198(AL)

nname: 0
n 0(self.wn.wn_gen.isConnected())[status = _('Disconnected')
try:
	pass
]:
	i: 
	o: 33(t), 198(f), 154()

nname: 198
n 198(None)[return status
]:
	i: 154(), 56(f), 0(f)
	o: 

nname: 154
n 154(None)[except Exception, e:
	log.error('unable to get status from wynetwork')
	PRINT_EXCEPTION(e)
]:
	i: 0()
	o: 198()

nname: 198
n 198(None)[return status
]:
	i: 154(), 56(f), 0(f)
	o: 

nname: 56
n 56(None)[for dev in self.wn.wn_dev.getDevices():
	dev_infos = self.wn.wn_dev.getDeviceInfos(dev)
	if dev_infos['active'] == 'true':
		if dev_infos['networkType'] == '802.11':
			pass
		status = _('Ethernet network')
		break
		continue
]:
	i: 33(for)
	o: 198()

nname: 33
n 33(None)[]:
	i: 0(t)
	o: 56(for)

nname: 0
n 0(self.wn.wn_gen.isConnected())[status = _('Disconnected')
try:
	pass
]:
	i: 
	o: 33(t), 198(f), 154()

nname: 198
n 198(None)[return status
]:
	i: 154(), 33(f), 0(f)
	o: 

nname: 154
n 154(None)[except Exception, e:
	log.error('unable to get status from wynetwork')
	PRINT_EXCEPTION(e)
]:
	i: 0()
	o: 198()

nname: 198
n 198(None)[return status
]:
	i: 154(), 33(f), 0(f)
	o: 

nname: 33
n 33(None)[for dev in self.wn.wn_dev.getDevices():
	dev_infos = self.wn.wn_dev.getDeviceInfos(dev)
	if dev_infos['active'] == 'true':
		if dev_infos['networkType'] == '802.11':
			pass
		status = _('Ethernet network')
		break
		continue
]:
	i: 0(t)
	o: 198()

nname: 0
n 0(self.wn.wn_gen.isConnected())[status = _('Disconnected')
try:
	pass
]:
	i: 
	o: 33(t), 198(f), 154()

nname: 198
n 198(None)[return status
]:
	i: 154(), 0(f)
	o: 

nname: 0
n 0(None)[status = _('Disconnected')
try:
	pass
if self.wn.wn_gen.isConnected():
	for dev in self.wn.wn_dev.getDevices():
		dev_infos = self.wn.wn_dev.getDeviceInfos(dev)
		if dev_infos['active'] == 'true':
			if dev_infos['networkType'] == '802.11':
				pass
			status = _('Ethernet network')
			break
			continue
]:
	i: 
	o: 198()

self.nodes: {0: <unpyclib.structure.node instance at 0xa21044c>, 154: <unpyclib.structure.node instance at 0xa210cec>, 198: <unpyclib.structure.node instance at 0xa2102cc>}
nname: 56
n 56(None)[return 'network_icon_wired_selected.png'
]:
	i: 47(), 55()
	o: 

nname: 55
n 55(None)[]:
	i: 0&18(f)
	o: 56()

nname: 47
n 47(None)[return 'network_icon_wireless_selected.png'
]:
	i: 0&18(t)
	o: 56()

nname: 0&18
n 0&18(self.wn.wn_gen.isConnected() and self.wn.wn_cfg.getActiveConfigurationInfos()['networkType'] != '802.3')[]:
	i: 
	o: 47(t), 55(f)

nname: 0&18
n 0&18(None)[if self.wn.wn_gen.isConnected() and self.wn.wn_cfg.getActiveConfigurationInfos()['networkType'] != '802.3':
	return 'network_icon_wireless_selected.png'
return 'network_icon_wired_selected.png'
]:
	i: 
	o: 

self.nodes: {'0&18': <unpyclib.structure.node instance at 0xa21056c>}
nname: 89
n 89(None)[return current_connection
]:
	i: 20(), 56()
	o: 

nname: 56
n 56(None)[current_connection = user_config['connections']['composite_output']
current_connection = str(current_connection).upper()
]:
	i: 0(f)
	o: 89()

nname: 20
n 20(None)[current_connection = hdmiresolution_dict.get(user_config['connections']['resolution'], _('N/A'))
]:
	i: 0(t)
	o: 89()

nname: 0
n 0(user_config['connections']['active_device'] == 'hdmi')[]:
	i: 
	o: 20(t), 56(f)

nname: 0
n 0(None)[if user_config['connections']['active_device'] == 'hdmi':
	current_connection = hdmiresolution_dict.get(user_config['connections']['resolution'], _('N/A'))
else:
	current_connection = user_config['connections']['composite_output']
	current_connection = str(current_connection).upper()
return current_connection
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa2109ec>}
nname: 0
n 0(None)[return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa210a8c>}
nname: 0
n 0(None)[return UNIVERSE_NAME_DICT[self.type]
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa2105ac>}
nname: 0
n 0(None)[return _('%(size)s total space') % {'size': get_space('/wymedia')}
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa2109ec>}
nname: 0
n 0(None)[return _('%(size)s available space') % {'size': get_free_available_space('/wymedia')}
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa2105ac>}
nname: 0
n 0(None)[self.parameters_items = []
self.parameters_menus = []
self.parameters_args = []
self.type = kw['type']
self._root_getter()
self.eventhandler = HorizontalNotebookMenuEventHandler(self)
NotebookMenu.__init__(self, name=name, choices=self.parameters_items, submenus=self.parameters_menus, subargs=self.parameters_args, subpos=-2, **kw)
self.set_items(self.parameters_items)
self.refresh_network_task = Task(self._refresh_network)
self.refresh_network_task.delay = 1
self.refresh_network = self.refresh_network_task.start
self.wn = WyNetwork()
self.wn.wn_dev.attach(self)
self.wn.wn_gen.attach(self)
def _network_text():
	status = _('Disconnected')
	try:
		pass
	if self.wn.wn_gen.isConnected():
		for dev in self.wn.wn_dev.getDevices():
			dev_infos = self.wn.wn_dev.getDeviceInfos(dev)
			if dev_infos['active'] == 'true':
				if dev_infos['networkType'] == '802.11':
					pass
				status = _('Ethernet network')
				break
				continue

def _network_icon():
	if self.wn.wn_gen.isConnected() and self.wn.wn_cfg.getActiveConfigurationInfos()['networkType'] != '802.3':
		return 'network_icon_wireless_selected.png'
	return 'network_icon_wired_selected.png'

def _connection_text():
	if user_config['connections']['active_device'] == 'hdmi':
		current_connection = hdmiresolution_dict.get(user_config['connections']['resolution'], _('N/A'))
	else:
		current_connection = user_config['connections']['composite_output']
		current_connection = str(current_connection).upper()
	return current_connection

self._getitems_keywords.update(dict(space_available=(lambda : _('%(size)s available space') % {'size': get_free_available_space('/wymedia')}), space_total=(lambda : _('%(size)s total space') % {'size': get_space('/wymedia')}), network=_network_text, network_icon=_network_icon, connection=_connection_text, universe_name=(lambda : UNIVERSE_NAME_DICT[self.type]), clock=(lambda : None)))
louie_connect(self.connection_switched, 'connection_switched')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa17bdac>}
nname: 285
n 285(None)[return None
]:
	i: 9(AL), 280(), 284()
	o: 

nname: 284
n 284(None)[]:
	i: 0(t)
	o: 285()

nname: 280
n 280(None)[]:
	i: 31(AF), 277()
	o: 285()

nname: 277
n 277(None)[]:
	i: 275(AE)
	o: 280()

nname: 275
n 275(None)[]:
	i: 246(f), 256()
	o: 277(AE)

nname: 256
n 256(None)[#, e
PRINT_EXCEPTION(e)
continue
]:
	i: 246(t)
	o: 275()

nname: 246
n 246(<dummy_ex3> EXC_MATCH Exception)[]:
	i: 53(except), 150()
	o: 256(t), 275(f)

nname: 150
n 150(None)[menu, arg = _submenus_dict[pname]()
menu.related_item = item
self.parameters_menus.append(menu)
self.parameters_items.append(item)
self.parameters_args.append(arg)
log.debug('pygui.item.parameters.%s loaded', pname)
continue
]:
	i: 142(), 149()
	o: 246()

nname: 149
n 149(None)[]:
	i: 81(f)
	o: 150()

nname: 142
n 142(None)[continue
]:
	i: 81(t)
	o: 150()

nname: 81
n 81(item is None)[_mod = __import__('pygui.item.parameters.' + pname, glob, loc, ['items'], level=0)
item = _mod.getitem(self)
]:
	i: 53(try)
	o: 142(t), 149(f)

nname: 53
n 53(None)[for pname in sorted(plugins.get('parameters')):
pname = pname.split('.', 1)[1]
]:
	i: 31(for)
	o: 81(try), 246(except)

nname: 31
n 31(None)[]:
	i: 9(loop)
	o: 53(for), 280(AF)

nname: 9
n 9(None)[glob = globals()
loc = locals()
]:
	i: 0(f)
	o: 31(loop), 285(AL)

nname: 0
n 0(self.parameters_items)[]:
	i: 
	o: 9(f), 284(t)

nname: 285
n 285(None)[return None
]:
	i: 9(AL), 31(AF), 246(AE), 0(t)
	o: 

nname: 246
n 246(None)[except Exception, e:
	PRINT_EXCEPTION(e)
	continue
]:
	i: 150(), 53()
	o: 285(AE)

nname: 150
n 150(None)[menu, arg = _submenus_dict[pname]()
menu.related_item = item
self.parameters_menus.append(menu)
self.parameters_items.append(item)
self.parameters_args.append(arg)
log.debug('pygui.item.parameters.%s loaded', pname)
continue
]:
	i: 53()
	o: 246()

nname: 53
n 53(None)[for pname in sorted(plugins.get('parameters')):
pname = pname.split('.', 1)[1]
try:
	_mod = __import__('pygui.item.parameters.' + pname, glob, loc, ['items'], level=0)
	item = _mod.getitem(self)
	if item is None:
		continue
]:
	i: 31(for)
	o: 150(), 246()

nname: 31
n 31(None)[]:
	i: 9(loop)
	o: 53(for), 285(AF)

nname: 9
n 9(None)[glob = globals()
loc = locals()
]:
	i: 0(f)
	o: 31(loop), 285(AL)

nname: 0
n 0(self.parameters_items)[]:
	i: 
	o: 9(f), 285(t)

self.nodes: {0: <unpyclib.structure.node instance at 0xa17ba6c>, 246: <unpyclib.structure.node instance at 0xa17bbac>, 9: <unpyclib.structure.node instance at 0xa17ba8c>, 53: <unpyclib.structure.node instance at 0xa17bb4c>, 150: <unpyclib.structure.node instance at 0xa17bc0c>, 285: <unpyclib.structure.node instance at 0xa17be4c>, 31: <unpyclib.structure.node instance at 0xa17bacc>}
nname: 0
n 0(None)[louie_send('connection', sender=self, value=value)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa170d0c>}
nname: 0
n 0(None)[self.refresh_connection(self['connection'])
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa170f4c>}
nname: 0
n 0(None)[net_name = self['network']
net_icon = self['network_icon']
louie_send('network', sender=self, value=net_name)
louie_send('network_icon', sender=self, value=net_icon)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa15eb0c>}
nname: 158
n 158(None)[]:
	i: 0(AL), 157()
	o: 

nname: 157
n 157(None)[]:
	i: 13(AF), 154()
	o: 158()

nname: 154
n 154(None)[]:
	i: 23(AL), 153()
	o: 157()

nname: 153
n 153(None)[]:
	i: 29(AF), 130()
	o: 154()

nname: 130
n 130(None)[menu_widget.sync_model_view()
menu_widget.update_i18n()
]:
	i: 39(AL), 129()
	o: 153()

nname: 129
n 129(None)[]:
	i: 54(AF), 126()
	o: 130()

nname: 126
n 126(None)[]:
	i: 70(AL), 125()
	o: 129()

nname: 125
n 125(None)[]:
	i: 76(AF), 122()
	o: 126()

nname: 122
n 122(None)[]:
	i: 120(AE)
	o: 125()

nname: 120
n 120(None)[]:
	i: 103(f), 113()
	o: 122(AE)

nname: 113
n 113(None)[continue
]:
	i: 103(t)
	o: 120()

nname: 103
n 103(<dummy_ex3> EXC_MATCH AttributeError)[]:
	i: 83(except), 89()
	o: 113(t), 120(f)

nname: 89
n 89(None)[item.update_name()
continue
]:
	i: 83(try)
	o: 103()

nname: 83
n 83(None)[for item in item_list:
]:
	i: 76(for)
	o: 89(try), 103(except)

nname: 76
n 76(None)[]:
	i: 70(loop)
	o: 83(for), 125(AF)

nname: 70
n 70(None)[for item_list in menu.item_lists_dict.itervalues():
]:
	i: 54(for)
	o: 76(loop), 126(AL)

nname: 54
n 54(None)[]:
	i: 39(loop)
	o: 70(for), 129(AF)

nname: 39
n 39(None)[for menu_widget in engine.menu_stack:
menu = menu_widget.menu
]:
	i: 29(for)
	o: 54(loop), 130(AL)

nname: 29
n 29(None)[]:
	i: 23(loop)
	o: 39(for), 153(AF)

nname: 23
n 23(None)[for engine in stack.engines:
]:
	i: 13(for)
	o: 29(loop), 154(AL)

nname: 13
n 13(None)[]:
	i: 0(loop)
	o: 23(for), 157(AF)

nname: 0
n 0(None)[stack = pygui_globs['menustack']
]:
	i: 
	o: 13(loop), 158(AL)

nname: 158
n 158(None)[]:
	i: 0(AL), 13(AF), 23(AL), 29(AF), 130()
	o: 

nname: 130
n 130(None)[menu_widget.sync_model_view()
menu_widget.update_i18n()
]:
	i: 39(AL), 54(AF), 70(AL), 76(AF), 103(AE)
	o: 158()

nname: 103
n 103(None)[except AttributeError:
	continue
]:
	i: 83()
	o: 130(AE)

nname: 83
n 83(None)[for item in item_list:
try:
	item.update_name()
	continue
]:
	i: 76(for)
	o: 103()

nname: 76
n 76(None)[]:
	i: 70(loop)
	o: 83(for), 130(AF)

nname: 70
n 70(None)[for item_list in menu.item_lists_dict.itervalues():
]:
	i: 54(for)
	o: 76(loop), 130(AL)

nname: 54
n 54(None)[]:
	i: 39(loop)
	o: 70(for), 130(AF)

nname: 39
n 39(None)[for menu_widget in engine.menu_stack:
menu = menu_widget.menu
]:
	i: 29(for)
	o: 54(loop), 130(AL)

nname: 29
n 29(None)[]:
	i: 23(loop)
	o: 39(for), 158(AF)

nname: 23
n 23(None)[for engine in stack.engines:
]:
	i: 13(for)
	o: 29(loop), 158(AL)

nname: 13
n 13(None)[]:
	i: 0(loop)
	o: 23(for), 158(AF)

nname: 0
n 0(None)[stack = pygui_globs['menustack']
]:
	i: 
	o: 13(loop), 158(AL)

nname: 158
n 158(None)[]:
	i: 0(AL), 13(AF), 23(AL), 29(AF), 130()
	o: 

nname: 130
n 130(None)[menu_widget.sync_model_view()
menu_widget.update_i18n()
]:
	i: 39(AL), 54(AF), 70(AL), 76(AF), 83(AE)
	o: 158()

nname: 83
n 83(None)[for item in item_list:
try:
	item.update_name()
	continue
except AttributeError:
	continue
]:
	i: 76(for)
	o: 130(AE)

nname: 76
n 76(None)[]:
	i: 70(loop)
	o: 83(for), 130(AF)

nname: 70
n 70(None)[for item_list in menu.item_lists_dict.itervalues():
]:
	i: 54(for)
	o: 76(loop), 130(AL)

nname: 54
n 54(None)[]:
	i: 39(loop)
	o: 70(for), 130(AF)

nname: 39
n 39(None)[for menu_widget in engine.menu_stack:
menu = menu_widget.menu
]:
	i: 29(for)
	o: 54(loop), 130(AL)

nname: 29
n 29(None)[]:
	i: 23(loop)
	o: 39(for), 158(AF)

nname: 23
n 23(None)[for engine in stack.engines:
]:
	i: 13(for)
	o: 29(loop), 158(AL)

nname: 13
n 13(None)[]:
	i: 0(loop)
	o: 23(for), 158(AF)

nname: 0
n 0(None)[stack = pygui_globs['menustack']
]:
	i: 
	o: 13(loop), 158(AL)

nname: 158
n 158(None)[]:
	i: 0(AL), 13(AF), 23(AL), 29(AF), 130()
	o: 

nname: 130
n 130(None)[menu_widget.sync_model_view()
menu_widget.update_i18n()
]:
	i: 39(AL), 54(AF), 83(AE)
	o: 158()

nname: 83
n 83(None)[for item in item_list:
	try:
		item.update_name()
		continue
	except AttributeError:
		continue
]:
	i: 70(for)
	o: 130(AE)

nname: 70
n 70(None)[for item_list in menu.item_lists_dict.itervalues():
]:
	i: 54(for)
	o: 83(for)

nname: 54
n 54(None)[]:
	i: 39(loop)
	o: 70(for), 130(AF)

nname: 39
n 39(None)[for menu_widget in engine.menu_stack:
menu = menu_widget.menu
]:
	i: 29(for)
	o: 54(loop), 130(AL)

nname: 29
n 29(None)[]:
	i: 23(loop)
	o: 39(for), 158(AF)

nname: 23
n 23(None)[for engine in stack.engines:
]:
	i: 13(for)
	o: 29(loop), 158(AL)

nname: 13
n 13(None)[]:
	i: 0(loop)
	o: 23(for), 158(AF)

nname: 0
n 0(None)[stack = pygui_globs['menustack']
]:
	i: 
	o: 13(loop), 158(AL)

nname: 158
n 158(None)[]:
	i: 0(AL), 13(AF), 23(AL), 29(AF), 130()
	o: 

nname: 130
n 130(None)[menu_widget.sync_model_view()
menu_widget.update_i18n()
]:
	i: 39(AL), 54(AF), 70(AE)
	o: 158()

nname: 70
n 70(None)[for item_list in menu.item_lists_dict.itervalues():
for item in item_list:
	try:
		item.update_name()
		continue
	except AttributeError:
		continue
]:
	i: 54(for)
	o: 130(AE)

nname: 54
n 54(None)[]:
	i: 39(loop)
	o: 70(for), 130(AF)

nname: 39
n 39(None)[for menu_widget in engine.menu_stack:
menu = menu_widget.menu
]:
	i: 29(for)
	o: 54(loop), 130(AL)

nname: 29
n 29(None)[]:
	i: 23(loop)
	o: 39(for), 158(AF)

nname: 23
n 23(None)[for engine in stack.engines:
]:
	i: 13(for)
	o: 29(loop), 158(AL)

nname: 13
n 13(None)[]:
	i: 0(loop)
	o: 23(for), 158(AF)

nname: 0
n 0(None)[stack = pygui_globs['menustack']
]:
	i: 
	o: 13(loop), 158(AL)

nname: 158
n 158(None)[]:
	i: 0(AL), 13(AF), 23(AL), 29(AF), 130()
	o: 

nname: 130
n 130(None)[menu_widget.sync_model_view()
menu_widget.update_i18n()
]:
	i: 70(AE)
	o: 158()

nname: 70
n 70(None)[for item_list in menu.item_lists_dict.itervalues():
	for item in item_list:
		try:
			item.update_name()
			continue
		except AttributeError:
			continue
]:
	i: 39(for)
	o: 130(AE)

nname: 39
n 39(None)[for menu_widget in engine.menu_stack:
menu = menu_widget.menu
]:
	i: 29(for)
	o: 70(for)

nname: 29
n 29(None)[]:
	i: 23(loop)
	o: 39(for), 158(AF)

nname: 23
n 23(None)[for engine in stack.engines:
]:
	i: 13(for)
	o: 29(loop), 158(AL)

nname: 13
n 13(None)[]:
	i: 0(loop)
	o: 23(for), 158(AF)

nname: 0
n 0(None)[stack = pygui_globs['menustack']
]:
	i: 
	o: 13(loop), 158(AL)

nname: 158
n 158(None)[]:
	i: 0(AL), 13(AF), 23(AL), 29(AF), 130()
	o: 

nname: 130
n 130(None)[menu_widget.sync_model_view()
menu_widget.update_i18n()
]:
	i: 39(AE)
	o: 158()

nname: 39
n 39(None)[for menu_widget in engine.menu_stack:
menu = menu_widget.menu
for item_list in menu.item_lists_dict.itervalues():
	for item in item_list:
		try:
			item.update_name()
			continue
		except AttributeError:
			continue
]:
	i: 29(for)
	o: 130(AE)

nname: 29
n 29(None)[]:
	i: 23(loop)
	o: 39(for), 158(AF)

nname: 23
n 23(None)[for engine in stack.engines:
]:
	i: 13(for)
	o: 29(loop), 158(AL)

nname: 13
n 13(None)[]:
	i: 0(loop)
	o: 23(for), 158(AF)

nname: 0
n 0(None)[stack = pygui_globs['menustack']
]:
	i: 
	o: 13(loop), 158(AL)

self.nodes: {0: <unpyclib.structure.node instance at 0xa17b58c>, 130: <unpyclib.structure.node instance at 0xa17bc0c>, 13: <unpyclib.structure.node instance at 0xa17b10c>, 23: <unpyclib.structure.node instance at 0xa17b2ec>, 158: <unpyclib.structure.node instance at 0xa17bf0c>, 39: <unpyclib.structure.node instance at 0xa17be4c>, 29: <unpyclib.structure.node instance at 0xa17b3cc>}
nname: 0
n 0(None)[self.wn.wn_gen.detach(self)
louie_disconnect(self.connection_switched, 'connection_switched')
NotebookMenu.stop(self)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa17092c>}
nname: 0
n 0(None)[self.refresh_network()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa17002c>}
nname: 0
n 0(None)[self.refresh_network()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa170a2c>}
nname: 0
n 0(None)[self.refresh_network()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa17086c>}
nname: 0
n 0(None)[self.refresh_network()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa170fcc>}
nname: 6
n 6(None)[universe = 'setup'
lazy_selection_delay = 1
def __init__(self, name, **kw):
	self.parameters_items = []
	self.parameters_menus = []
	self.parameters_args = []
	self.type = kw['type']
	self._root_getter()
	self.eventhandler = HorizontalNotebookMenuEventHandler(self)
	NotebookMenu.__init__(self, name=name, choices=self.parameters_items, submenus=self.parameters_menus, subargs=self.parameters_args, subpos=-2, **kw)
	self.set_items(self.parameters_items)
	self.refresh_network_task = Task(self._refresh_network)
	self.refresh_network_task.delay = 1
	self.refresh_network = self.refresh_network_task.start
	self.wn = WyNetwork()
	self.wn.wn_dev.attach(self)
	self.wn.wn_gen.attach(self)
	def _network_text():
		status = _('Disconnected')
		try:
			pass
		if self.wn.wn_gen.isConnected():
			for dev in self.wn.wn_dev.getDevices():
				dev_infos = self.wn.wn_dev.getDeviceInfos(dev)
				if dev_infos['active'] == 'true':
					if dev_infos['networkType'] == '802.11':
						pass
					status = _('Ethernet network')
					break
					continue

	def _network_icon():
		if self.wn.wn_gen.isConnected() and self.wn.wn_cfg.getActiveConfigurationInfos()['networkType'] != '802.3':
			return 'network_icon_wireless_selected.png'
		return 'network_icon_wired_selected.png'

	def _connection_text():
		if user_config['connections']['active_device'] == 'hdmi':
			current_connection = hdmiresolution_dict.get(user_config['connections']['resolution'], _('N/A'))
		else:
			current_connection = user_config['connections']['composite_output']
			current_connection = str(current_connection).upper()
		return current_connection

	self._getitems_keywords.update(dict(space_available=(lambda : _('%(size)s available space') % {'size': get_free_available_space('/wymedia')}), space_total=(lambda : _('%(size)s total space') % {'size': get_space('/wymedia')}), network=_network_text, network_icon=_network_icon, connection=_connection_text, universe_name=(lambda : UNIVERSE_NAME_DICT[self.type]), clock=(lambda : None)))
	louie_connect(self.connection_switched, 'connection_switched')

def _root_getter(self):
	pass

def refresh_connection(self, value):
	louie_send('connection', sender=self, value=value)

def connection_switched(self, signal):
	self.refresh_connection(self['connection'])

def _refresh_network(self):
	net_name = self['network']
	net_icon = self['network_icon']
	louie_send('network', sender=self, value=net_name)
	louie_send('network_icon', sender=self, value=net_icon)

def on_modify_lang(self):
	stack = pygui_globs['menustack']

def stop(self):
	self.wn.wn_gen.detach(self)
	louie_disconnect(self.connection_switched, 'connection_switched')
	NotebookMenu.stop(self)

def onConnected(self):
	self.refresh_network()

def onDisconnected(self):
	self.refresh_network()

def onDeviceConnected(self, device):
	self.refresh_network()

def onDeviceDisconnected(self, device):
	self.refresh_network()

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xa1606ec>}
nname: 0
n 0(None)[return self.get_item_list('options_list')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa20c52c>}
nname: 0
n 0(None)[return self.get_item_list('center_list')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa20c1ac>}
nname: 122
n 122(None)[self.browse_selected_task = Task(self._browse_selected)
self.browse_selected_task.delay = 0.5
self.browse_selected = self.browse_selected_task.start
]:
	i: 107(), 121()
	o: 

nname: 121
n 121(None)[]:
	i: 0(f)
	o: 122()

nname: 107
n 107(None)[self._browse_main()
]:
	i: 0(t)
	o: 122()

nname: 0
n 0(browse_at_init)[self.eventhandler = ParametersSubMenuEventHandler(self)
NotebookSubMenu.__init__(self, *args, **kw)
self.available_choices = ['main_list', 'center_list', 'options_list']
self._getitems_keywords.update(dict(center_list=(lambda : self.get_item_list('center_list')), options_list=(lambda : self.get_item_list('options_list'))))
]:
	i: 
	o: 107(t), 121(f)

nname: 0
n 0(None)[self.eventhandler = ParametersSubMenuEventHandler(self)
NotebookSubMenu.__init__(self, *args, **kw)
self.available_choices = ['main_list', 'center_list', 'options_list']
self._getitems_keywords.update(dict(center_list=(lambda : self.get_item_list('center_list')), options_list=(lambda : self.get_item_list('options_list'))))
if browse_at_init:
	self._browse_main()
self.browse_selected_task = Task(self._browse_selected)
self.browse_selected_task.delay = 0.5
self.browse_selected = self.browse_selected_task.start
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa17bc8c>}
nname: 0
n 0(None)[item_list = self.get_item_list('main_list')
item_list.select(value)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa1600ac>}
nname: 32
n 32(None)[ret = item_list.selected
return ret
]:
	i: 0(t), 24()
	o: 

nname: 24
n 24(None)[]:
	i: 0(f)
	o: 32()

nname: 0
n 0(item_list.selected)[item_list = self.get_item_list('main_list')
]:
	i: 
	o: 24(f), 32(t)

nname: 0
n 0(None)[item_list = self.get_item_list('main_list')
if not item_list.selected:
	pass
ret = item_list.selected
return ret
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa17b26c>}
nname: 0
n 0(None)[item_list = self.get_item_list('center_list')
item_list.select(value)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa16016c>}
nname: 32
n 32(None)[ret = item_list.selected
return ret
]:
	i: 0(t), 24()
	o: 

nname: 24
n 24(None)[]:
	i: 0(f)
	o: 32()

nname: 0
n 0(item_list.selected)[item_list = self.get_item_list('center_list')
]:
	i: 
	o: 24(f), 32(t)

nname: 0
n 0(None)[item_list = self.get_item_list('center_list')
if not item_list.selected:
	pass
ret = item_list.selected
return ret
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa17b18c>}
nname: 0
n 0(None)[item_list = self.get_item_list('options_list')
item_list.select(value)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa16098c>}
nname: 32
n 32(None)[ret = item_list.selected
return ret
]:
	i: 0(t), 24()
	o: 

nname: 24
n 24(None)[]:
	i: 0(f)
	o: 32()

nname: 0
n 0(item_list.selected)[item_list = self.get_item_list('options_list')
]:
	i: 
	o: 24(f), 32(t)

nname: 0
n 0(None)[item_list = self.get_item_list('options_list')
if not item_list.selected:
	pass
ret = item_list.selected
return ret
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa17b10c>}
nname: 186
n 186(None)[]:
	i: 113(JA), 149(), 153()
	o: 

nname: 153
n 153(None)[self.set_items([], 'center_list')
self.set_items([], 'options_list')
]:
	i: 21(f)
	o: 186()

nname: 149
n 149(None)[]:
	i: 98(f)
	o: 186()

nname: 113
n 113(None)[self.set_items(item_top.browse(), 'center_list')
self._browse_center()
]:
	i: 98(t)
	o: 186(JA)

nname: 98
n 98(item_top.depth == 3)[]:
	i: 55(), 97()
	o: 113(t), 149(f)

nname: 97
n 97(None)[]:
	i: 39(f)
	o: 98()

nname: 55
n 55(None)[self.set_items([], 'center_list')
self.set_items(item_top.browse(), 'options_list')
]:
	i: 39(t)
	o: 98()

nname: 39
n 39(item_top.depth == 2)[]:
	i: 21(t)
	o: 55(t), 97(f)

nname: 21
n 21(hasattr(item_top, 'depth'))[item_top = self.selected_main
]:
	i: 0(t), 9()
	o: 39(t), 153(f)

nname: 9
n 9(None)[]:
	i: 0(f)
	o: 21()

nname: 0
n 0(self.selected_main)[]:
	i: 
	o: 9(f), 21(t)

nname: 186
n 186(None)[]:
	i: 39(JA), 153()
	o: 

nname: 153
n 153(None)[self.set_items([], 'center_list')
self.set_items([], 'options_list')
]:
	i: 0(f)
	o: 186()

nname: 39
n 39(None)[if item_top.depth == 2:
	self.set_items([], 'center_list')
	self.set_items(item_top.browse(), 'options_list')
if item_top.depth == 3:
	self.set_items(item_top.browse(), 'center_list')
	self._browse_center()
]:
	i: 0(t)
	o: 186(JA)

nname: 0
n 0(hasattr(item_top, 'depth'))[if not self.selected_main:
	pass
item_top = self.selected_main
]:
	i: 
	o: 39(t), 153(f)

nname: 0
n 0(None)[if not self.selected_main:
	pass
item_top = self.selected_main
if hasattr(item_top, 'depth'):
	if item_top.depth == 2:
		self.set_items([], 'center_list')
		self.set_items(item_top.browse(), 'options_list')
	if item_top.depth == 3:
		self.set_items(item_top.browse(), 'center_list')
		self._browse_center()
else:
	self.set_items([], 'center_list')
	self.set_items([], 'options_list')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa17b30c>}
nname: 60
n 60(None)[self.set_items(content, 'options_list')
]:
	i: 3(), 32(), 58(AE)
	o: 

nname: 58
n 58(None)[]:
	i: 22(f)
	o: 60(AE)

nname: 32
n 32(None)[log.debug('Center Item is not browseable')
content = []
]:
	i: 22(t)
	o: 60()

nname: 22
n 22(<dummy_ex3> EXC_MATCH AttributeError)[]:
	i: 0(except)
	o: 32(t), 58(f)

nname: 3
n 3(None)[content = self.selected_center.browse()
]:
	i: 0(try)
	o: 60()

nname: 0
n 0(None)[]:
	i: 
	o: 3(try), 22(except)

nname: 22
n 22(None)[except AttributeError:
	log.debug('Center Item is not browseable')
	content = []
self.set_items(content, 'options_list')
]:
	i: 0()
	o: 

nname: 0
n 0(None)[try:
	content = self.selected_center.browse()
]:
	i: 
	o: 22()

nname: 0
n 0(None)[try:
	content = self.selected_center.browse()
except AttributeError:
	log.debug('Center Item is not browseable')
	content = []
self.set_items(content, 'options_list')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa17b2cc>}
nname: 0
n 0(None)[return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa17b58c>}
nname: 0
n 0(None)[return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa17b5cc>}
nname: 0
n 0(None)[switch = {'main_list': self._browse_main, 'center_list': self._browse_center}
switch.get(self.active_list, (lambda : None))()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa17baec>}
nname: 120
n 120(None)[]:
	i: 67(), 93()
	o: 

nname: 93
n 93(None)[log.debug('NEXT without center hop')
Menu.focus_next(self)
]:
	i: 40&55(f)
	o: 120()

nname: 67
n 67(None)[log.debug('NEXT with center hop')
self.active_list = 'options_list'
]:
	i: 40&55(t)
	o: 120()

nname: 40&55
n 40&55(self.active_list == 'main_list' and not self['center_list'])[]:
	i: 12(), 39()
	o: 67(t), 93(f)

nname: 39
n 39(None)[]:
	i: 0(f)
	o: 40&55()

nname: 12
n 12(None)[self.browse_selected_task.stop()
self._browse_selected()
]:
	i: 0(t)
	o: 40&55()

nname: 0
n 0(self.browse_selected_task.running)[]:
	i: 
	o: 12(t), 39(f)

nname: 120
n 120(None)[]:
	i: 0()
	o: 

nname: 0
n 0(None)[if self.browse_selected_task.running:
	self.browse_selected_task.stop()
	self._browse_selected()
if self.active_list == 'main_list' and not self['center_list']:
	log.debug('NEXT with center hop')
	self.active_list = 'options_list'
else:
	log.debug('NEXT without center hop')
	Menu.focus_next(self)
]:
	i: 
	o: 120()

nname: 0
n 0(None)[if self.browse_selected_task.running:
	self.browse_selected_task.stop()
	self._browse_selected()
if self.active_list == 'main_list' and not self['center_list']:
	log.debug('NEXT with center hop')
	self.active_list = 'options_list'
else:
	log.debug('NEXT without center hop')
	Menu.focus_next(self)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa17b62c>}
nname: 91
n 91(None)[]:
	i: 15(), 51(), 77()
	o: 

nname: 77
n 77(None)[Menu.focus_previous(self)
]:
	i: 23&39(f)
	o: 91()

nname: 51
n 51(None)[log.debug('PREV with center hop')
self.active_list = 'main_list'
]:
	i: 23&39(t)
	o: 91()

nname: 23&39
n 23&39(self.active_list == 'options_list' and not self['center_list'])[]:
	i: 0(f)
	o: 51(t), 77(f)

nname: 15
n 15(None)[return False
]:
	i: 0(t)
	o: 91()

nname: 0
n 0(self.active_list == 'main_list')[]:
	i: 
	o: 15(t), 23&39(f)

nname: 0
n 0(None)[if self.active_list == 'main_list':
	return False
else:
	if self.active_list == 'options_list' and not self['center_list']:
		log.debug('PREV with center hop')
		self.active_list = 'main_list'
	else:
		Menu.focus_previous(self)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa17bd4c>}
nname: 0
n 0(None)[self.selected.display_type = 'checked'
self.focus_previous()
self.browse_selected()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa16088c>}
nname: 6
n 6(None)[__doc__ = "\n    Menu related to page 'General', 'Photo/Video', 'Connections'\n    "
universe = 'setup'
def __init__(self, browse_at_init=True, *args, **args):
	self.eventhandler = ParametersSubMenuEventHandler(self)
	NotebookSubMenu.__init__(self, *args, **kw)
	self.available_choices = ['main_list', 'center_list', 'options_list']
	self._getitems_keywords.update(dict(center_list=(lambda : self.get_item_list('center_list')), options_list=(lambda : self.get_item_list('options_list'))))
	if browse_at_init:
		self._browse_main()
	self.browse_selected_task = Task(self._browse_selected)
	self.browse_selected_task.delay = 0.5
	self.browse_selected = self.browse_selected_task.start

def _set_main(self, value):
	item_list = self.get_item_list('main_list')
	item_list.select(value)

def _get_main(self):
	item_list = self.get_item_list('main_list')
	if not item_list.selected:
		pass
	ret = item_list.selected
	return ret

selected_main = property(_get_main, _set_main)
del _get_main
del _set_main
def _set_center(self, value):
	item_list = self.get_item_list('center_list')
	item_list.select(value)

def _get_center(self):
	item_list = self.get_item_list('center_list')
	if not item_list.selected:
		pass
	ret = item_list.selected
	return ret

selected_center = property(_get_center, _set_center)
del _get_center
del _set_center
def _set_options(self, value):
	item_list = self.get_item_list('options_list')
	item_list.select(value)

def _get_options(self):
	item_list = self.get_item_list('options_list')
	if not item_list.selected:
		pass
	ret = item_list.selected
	return ret

selected_options = property(_get_options, _set_options)
del _get_options
del _set_options
def _browse_main(self):
	if not self.selected_main:
		pass
	item_top = self.selected_main
	if hasattr(item_top, 'depth'):
		if item_top.depth == 2:
			self.set_items([], 'center_list')
			self.set_items(item_top.browse(), 'options_list')
		if item_top.depth == 3:
			self.set_items(item_top.browse(), 'center_list')
			self._browse_center()
	else:
		self.set_items([], 'center_list')
		self.set_items([], 'options_list')

def _browse_center(self):
	try:
		content = self.selected_center.browse()
	except AttributeError:
		log.debug('Center Item is not browseable')
		content = []
	self.set_items(content, 'options_list')

def _browse_selected(self):
	switch = {'main_list': self._browse_main, 'center_list': self._browse_center}
	switch.get(self.active_list, (lambda : None))()

def focus_next(self):
	if self.browse_selected_task.running:
		self.browse_selected_task.stop()
		self._browse_selected()
	if self.active_list == 'main_list' and not self['center_list']:
		log.debug('NEXT with center hop')
		self.active_list = 'options_list'
	else:
		log.debug('NEXT without center hop')
		Menu.focus_next(self)

def focus_previous(self):
	if self.active_list == 'main_list':
		return False
	else:
		if self.active_list == 'options_list' and not self['center_list']:
			log.debug('PREV with center hop')
			self.active_list = 'main_list'
		else:
			Menu.focus_previous(self)

def _set_options_list(self, selection, keep_selection=False):
	self.selected.display_type = 'checked'
	self.focus_previous()
	self.browse_selected()

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xa15e9ac>}
nname: 0
n 0(None)[self.first_parental = False
self._secret_code_launched = False
GeneralNotebookSubMenuParameters.__init__(self, *args, **kw)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa17086c>}
nname: 0
n 0(None)[user_config['security']['parental_control'] = False
user_config.save()
SecretCodeSetupParametersMenu(name='', verif_first=False).show()
self._secret_code_launched = True
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa17076c>}
nname: 0
n 0(None)[user_config['security']['parental_control'] = True
user_config['security']['secretcode'] = self._secret_code_value
user_config.save()
self.end_func()
self.first_parental = False
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa17b24c>}
nname: 119
n 119(None)[return None
]:
	i: 30(), 118()
	o: 

nname: 118
n 118(None)[]:
	i: 0&9(f)
	o: 119()

nname: 30
n 30(None)[self._secret_code_value = user_config['security']['secretcode']
user_config['security']['secretcode'] = None
user_config.save()
def _set_parental_ok():
	user_config['security']['parental_control'] = True
	user_config['security']['secretcode'] = self._secret_code_value
	user_config.save()
	self.end_func()
	self.first_parental = False

self._secret_code_launched = False
QuestionAnswerSetupParametersLauncher(check=False, end_action=_set_parental_ok)
]:
	i: 0&9(t)
	o: 119()

nname: 0&9
n 0&9(self._secret_code_launched and user_config['security']['secretcode'] is not None)[]:
	i: 
	o: 30(t), 118(f)

nname: 0&9
n 0&9(None)[if self._secret_code_launched and user_config['security']['secretcode'] is not None:
	self._secret_code_value = user_config['security']['secretcode']
	user_config['security']['secretcode'] = None
	user_config.save()
	def _set_parental_ok():
		user_config['security']['parental_control'] = True
		user_config['security']['secretcode'] = self._secret_code_value
		user_config.save()
		self.end_func()
		self.first_parental = False

	self._secret_code_launched = False
	QuestionAnswerSetupParametersLauncher(check=False, end_action=_set_parental_ok)
return None
]:
	i: 
	o: 

self.nodes: {'0&9': <unpyclib.structure.node instance at 0xa15ee0c>}
nname: 6
n 6(None)[def __init__(self, *args, **args):
	self.first_parental = False
	self._secret_code_launched = False
	GeneralNotebookSubMenuParameters.__init__(self, *args, **kw)

def on_first_parental_control(self):
	user_config['security']['parental_control'] = False
	user_config.save()
	SecretCodeSetupParametersMenu(name='', verif_first=False).show()
	self._secret_code_launched = True

def reload_func(self):
	if self._secret_code_launched and user_config['security']['secretcode'] is not None:
		self._secret_code_value = user_config['security']['secretcode']
		user_config['security']['secretcode'] = None
		user_config.save()
		def _set_parental_ok():
			user_config['security']['parental_control'] = True
			user_config['security']['secretcode'] = self._secret_code_value
			user_config.save()
			self.end_func()
			self.first_parental = False

		self._secret_code_launched = False
		QuestionAnswerSetupParametersLauncher(check=False, end_action=_set_parental_ok)
	return None

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xa1707ac>}
nname: 0
n 0(None)[return self.get_item_list('aspect_ratio_options_list')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa160dac>}
nname: 0
n 0(None)[GeneralNotebookSubMenuParameters.__init__(self, browse_at_init=False, *args, **kw)
self.available_choices = ['main_list', 'center_list', 'options_list', 'aspect_ratio_options_list']
self._getitems_keywords.update(dict(aspect_ratio_options_list=(lambda : self.get_item_list('aspect_ratio_options_list'))))
self._browse_main()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa15ee4c>}
nname: 144
n 144(None)[]:
	i: 79(), 114()
	o: 

nname: 114
n 114(None)[GeneralNotebookSubMenuParameters._browse_main(self)
self.set_items([], 'aspect_ratio_options_list')
]:
	i: 0(f)
	o: 144()

nname: 79
n 79(None)[self.set_items(content, 'aspect_ratio_options_list')
self.set_items([], 'options_list')
]:
	i: 22(), 51(), 77(AE)
	o: 144()

nname: 77
n 77(None)[]:
	i: 41(f)
	o: 79(AE)

nname: 51
n 51(None)[log.debug('Center Item is not browseable')
content = []
]:
	i: 41(t)
	o: 79()

nname: 41
n 41(<dummy_ex3> EXC_MATCH AttributeError)[]:
	i: 18(except)
	o: 51(t), 77(f)

nname: 22
n 22(None)[content = self.selected_main.browse()
]:
	i: 18(try)
	o: 79()

nname: 18
n 18(None)[]:
	i: 0(t)
	o: 22(try), 41(except)

nname: 0
n 0(isinstance(self.selected_main, AspectRatioParametersSetupItem))[]:
	i: 
	o: 18(t), 114(f)

nname: 144
n 144(None)[]:
	i: 41(), 114()
	o: 

nname: 114
n 114(None)[GeneralNotebookSubMenuParameters._browse_main(self)
self.set_items([], 'aspect_ratio_options_list')
]:
	i: 0(f)
	o: 144()

nname: 41
n 41(None)[except AttributeError:
	log.debug('Center Item is not browseable')
	content = []
self.set_items(content, 'aspect_ratio_options_list')
self.set_items([], 'options_list')
]:
	i: 18()
	o: 144()

nname: 18
n 18(None)[try:
	content = self.selected_main.browse()
]:
	i: 0(t)
	o: 41()

nname: 0
n 0(isinstance(self.selected_main, AspectRatioParametersSetupItem))[]:
	i: 
	o: 18(t), 114(f)

nname: 144
n 144(None)[]:
	i: 18(), 114()
	o: 

nname: 114
n 114(None)[GeneralNotebookSubMenuParameters._browse_main(self)
self.set_items([], 'aspect_ratio_options_list')
]:
	i: 0(f)
	o: 144()

nname: 18
n 18(None)[try:
	content = self.selected_main.browse()
except AttributeError:
	log.debug('Center Item is not browseable')
	content = []
self.set_items(content, 'aspect_ratio_options_list')
self.set_items([], 'options_list')
]:
	i: 0(t)
	o: 144()

nname: 0
n 0(isinstance(self.selected_main, AspectRatioParametersSetupItem))[]:
	i: 
	o: 18(t), 114(f)

nname: 0
n 0(None)[if isinstance(self.selected_main, AspectRatioParametersSetupItem):
	try:
		content = self.selected_main.browse()
	except AttributeError:
		log.debug('Center Item is not browseable')
		content = []
	self.set_items(content, 'aspect_ratio_options_list')
	self.set_items([], 'options_list')
else:
	GeneralNotebookSubMenuParameters._browse_main(self)
	self.set_items([], 'aspect_ratio_options_list')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa1600ac>}
nname: 101
n 101(None)[]:
	i: 75(), 87()
	o: 

nname: 87
n 87(None)[GeneralNotebookSubMenuParameters.focus_next(self)
]:
	i: 0&18(f)
	o: 101()

nname: 75
n 75(None)[self.active_list = 'aspect_ratio_options_list'
]:
	i: 47(), 74()
	o: 101()

nname: 74
n 74(None)[]:
	i: 34(f)
	o: 75()

nname: 47
n 47(None)[self.browse_selected_task.stop()
self._browse_selected()
]:
	i: 34(t)
	o: 75()

nname: 34
n 34(self.browse_selected_task.running)[]:
	i: 0&18(t)
	o: 47(t), 74(f)

nname: 0&18
n 0&18(isinstance(self.selected_main, AspectRatioParametersSetupItem) and self.active_list == 'main_list')[]:
	i: 
	o: 34(t), 87(f)

nname: 101
n 101(None)[]:
	i: 34(), 87()
	o: 

nname: 87
n 87(None)[GeneralNotebookSubMenuParameters.focus_next(self)
]:
	i: 0&18(f)
	o: 101()

nname: 34
n 34(None)[if self.browse_selected_task.running:
	self.browse_selected_task.stop()
	self._browse_selected()
self.active_list = 'aspect_ratio_options_list'
]:
	i: 0&18(t)
	o: 101()

nname: 0&18
n 0&18(isinstance(self.selected_main, AspectRatioParametersSetupItem) and self.active_list == 'main_list')[]:
	i: 
	o: 34(t), 87(f)

nname: 0&18
n 0&18(None)[if isinstance(self.selected_main, AspectRatioParametersSetupItem) and self.active_list == 'main_list':
	if self.browse_selected_task.running:
		self.browse_selected_task.stop()
		self._browse_selected()
	self.active_list = 'aspect_ratio_options_list'
else:
	GeneralNotebookSubMenuParameters.focus_next(self)
]:
	i: 
	o: 

self.nodes: {'0&18': <unpyclib.structure.node instance at 0xa15ec2c>}
nname: 66
n 66(None)[]:
	i: 15(), 39(), 52()
	o: 

nname: 52
n 52(None)[GeneralNotebookSubMenuParameters.focus_previous(self)
]:
	i: 23(f)
	o: 66()

nname: 39
n 39(None)[self.active_list = 'main_list'
]:
	i: 23(t)
	o: 66()

nname: 23
n 23(self.active_list in ('options_list', 'aspect_ratio_options_list'))[]:
	i: 0(f)
	o: 39(t), 52(f)

nname: 15
n 15(None)[return False
]:
	i: 0(t)
	o: 66()

nname: 0
n 0(self.active_list == 'main_list')[]:
	i: 
	o: 15(t), 23(f)

nname: 0
n 0(None)[if self.active_list == 'main_list':
	return False
else:
	if self.active_list in ('options_list', 'aspect_ratio_options_list'):
		self.active_list = 'main_list'
	else:
		GeneralNotebookSubMenuParameters.focus_previous(self)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa15eb4c>}
nname: 0
n 0(None)[self.selected.display_type = 'checked'
self.focus_previous()
self.browse_selected()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa170c4c>}
nname: 6
n 6(None)[def __init__(self, *args, **args):
	GeneralNotebookSubMenuParameters.__init__(self, browse_at_init=False, *args, **kw)
	self.available_choices = ['main_list', 'center_list', 'options_list', 'aspect_ratio_options_list']
	self._getitems_keywords.update(dict(aspect_ratio_options_list=(lambda : self.get_item_list('aspect_ratio_options_list'))))
	self._browse_main()

def _browse_main(self):
	if isinstance(self.selected_main, AspectRatioParametersSetupItem):
		try:
			content = self.selected_main.browse()
		except AttributeError:
			log.debug('Center Item is not browseable')
			content = []
		self.set_items(content, 'aspect_ratio_options_list')
		self.set_items([], 'options_list')
	else:
		GeneralNotebookSubMenuParameters._browse_main(self)
		self.set_items([], 'aspect_ratio_options_list')

def focus_next(self):
	if isinstance(self.selected_main, AspectRatioParametersSetupItem) and self.active_list == 'main_list':
		if self.browse_selected_task.running:
			self.browse_selected_task.stop()
			self._browse_selected()
		self.active_list = 'aspect_ratio_options_list'
	else:
		GeneralNotebookSubMenuParameters.focus_next(self)

def focus_previous(self):
	if self.active_list == 'main_list':
		return False
	else:
		if self.active_list in ('options_list', 'aspect_ratio_options_list'):
			self.active_list = 'main_list'
		else:
			GeneralNotebookSubMenuParameters.focus_previous(self)

def _set_options_list(self, selection, keep_selection=False):
	self.selected.display_type = 'checked'
	self.focus_previous()
	self.browse_selected()

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xa1708cc>}
nname: 56
n 56(None)[]:
	i: 34(), 42()
	o: 

nname: 42
n 42(None)[GeneralNotebookSubMenuParameters.focus_next(self)
]:
	i: 0(f)
	o: 56()

nname: 34
n 34(None)[return False
]:
	i: 0(t)
	o: 56()

nname: 0
n 0(isinstance(self.selected, ReInitBoxItem))[from pygui.item.parameters.advanced.advancedsetup import ReInitBoxItem
]:
	i: 
	o: 34(t), 42(f)

nname: 0
n 0(None)[from pygui.item.parameters.advanced.advancedsetup import ReInitBoxItem
if isinstance(self.selected, ReInitBoxItem):
	return False
else:
	GeneralNotebookSubMenuParameters.focus_next(self)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa170f4c>}
nname: 6
n 6(None)[def focus_next(self):
	from pygui.item.parameters.advanced.advancedsetup import ReInitBoxItem
	if isinstance(self.selected, ReInitBoxItem):
		return False
	else:
		GeneralNotebookSubMenuParameters.focus_next(self)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xa1707ac>}
nname: 0
n 0(None)[self.eventhandler = ParametersSubMenuEventHandler(self)
NotebookSubMenu.__init__(self, *args, **kw)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa170eac>}
nname: 0
n 0(None)[return False
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa170f4c>}
nname: 0
n 0(None)[return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa17064c>}
nname: 6
n 6(None)[universe = 'setup'
def __init__(self, *args, **args):
	self.eventhandler = ParametersSubMenuEventHandler(self)
	NotebookSubMenu.__init__(self, *args, **kw)

def focus_next(self):
	return False

focus_previous = focus_next
def browse_selected(self):
	return None

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xa1707cc>}
nname: 65
n 65(None)[return None
]:
	i: 47(), 64()
	o: 

nname: 64
n 64(None)[]:
	i: 0(f)
	o: 65()

nname: 47
n 47(None)[self['options_list'].selected = None
]:
	i: 0(t)
	o: 65()

nname: 0
n 0(isinstance(self.selected, StatusNetworkConfSetupItem))[from pygui.item.parameters.network.networksetup import StatusNetworkConfSetupItem
GeneralNotebookSubMenuParameters._browse_main(self)
]:
	i: 
	o: 47(t), 64(f)

nname: 0
n 0(None)[from pygui.item.parameters.network.networksetup import StatusNetworkConfSetupItem
GeneralNotebookSubMenuParameters._browse_main(self)
if isinstance(self.selected, StatusNetworkConfSetupItem):
	self['options_list'].selected = None
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa17094c>}
nname: 0
n 0(None)[return False
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa170a6c>}
nname: 0
n 0(None)[return False
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa17002c>}
nname: 6
n 6(None)[def _browse_main(self):
	from pygui.item.parameters.network.networksetup import StatusNetworkConfSetupItem
	GeneralNotebookSubMenuParameters._browse_main(self)
	if isinstance(self.selected, StatusNetworkConfSetupItem):
		self['options_list'].selected = None
	return None

def focus_previous(self):
	return False

def focus_next(self):
	return False

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xa1707cc>}
nname: 0
n 0(None)[return self.get_item_list('options_auto_list')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa16006c>}
nname: 0
n 0(None)[GeneralNotebookSubMenuParameters.__init__(self, browse_at_init=False, *args, **kw)
self.available_choices = ['main_list', 'center_list', 'options_list', 'options_auto_list']
self._getitems_keywords.update(dict(options_auto_list=(lambda : self.get_item_list('options_auto_list'))))
self._browse_main()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa15ef0c>}
nname: 176
n 176(None)[]:
	i: 95(), 130()
	o: 

nname: 130
n 130(None)[GeneralNotebookSubMenuParameters._browse_main(self)
self.set_items([], 'options_auto_list')
louie_send('remove_tv_button', sender=self)
]:
	i: 0(f)
	o: 176()

nname: 95
n 95(None)[self.set_items(content, 'options_auto_list')
self.set_items([], 'options_list')
]:
	i: 22(), 67(), 93(AE)
	o: 176()

nname: 93
n 93(None)[]:
	i: 57(f)
	o: 95(AE)

nname: 67
n 67(None)[log.debug('Center Item is not browseable')
content = []
]:
	i: 57(t)
	o: 95()

nname: 57
n 57(<dummy_ex3> EXC_MATCH AttributeError)[]:
	i: 18(except)
	o: 67(t), 93(f)

nname: 22
n 22(None)[content = self.selected_main.browse()
louie_send('show_tv_button', sender=self)
]:
	i: 18(try)
	o: 95()

nname: 18
n 18(None)[]:
	i: 0(t)
	o: 22(try), 57(except)

nname: 0
n 0(isinstance(self.selected_main, TNTScanMenuSetupItem))[]:
	i: 
	o: 18(t), 130(f)

nname: 176
n 176(None)[]:
	i: 57(), 130()
	o: 

nname: 130
n 130(None)[GeneralNotebookSubMenuParameters._browse_main(self)
self.set_items([], 'options_auto_list')
louie_send('remove_tv_button', sender=self)
]:
	i: 0(f)
	o: 176()

nname: 57
n 57(None)[except AttributeError:
	log.debug('Center Item is not browseable')
	content = []
self.set_items(content, 'options_auto_list')
self.set_items([], 'options_list')
]:
	i: 18()
	o: 176()

nname: 18
n 18(None)[try:
	content = self.selected_main.browse()
	louie_send('show_tv_button', sender=self)
]:
	i: 0(t)
	o: 57()

nname: 0
n 0(isinstance(self.selected_main, TNTScanMenuSetupItem))[]:
	i: 
	o: 18(t), 130(f)

nname: 176
n 176(None)[]:
	i: 18(), 130()
	o: 

nname: 130
n 130(None)[GeneralNotebookSubMenuParameters._browse_main(self)
self.set_items([], 'options_auto_list')
louie_send('remove_tv_button', sender=self)
]:
	i: 0(f)
	o: 176()

nname: 18
n 18(None)[try:
	content = self.selected_main.browse()
	louie_send('show_tv_button', sender=self)
except AttributeError:
	log.debug('Center Item is not browseable')
	content = []
self.set_items(content, 'options_auto_list')
self.set_items([], 'options_list')
]:
	i: 0(t)
	o: 176()

nname: 0
n 0(isinstance(self.selected_main, TNTScanMenuSetupItem))[]:
	i: 
	o: 18(t), 130(f)

nname: 0
n 0(None)[if isinstance(self.selected_main, TNTScanMenuSetupItem):
	try:
		content = self.selected_main.browse()
		louie_send('show_tv_button', sender=self)
	except AttributeError:
		log.debug('Center Item is not browseable')
		content = []
	self.set_items(content, 'options_auto_list')
	self.set_items([], 'options_list')
else:
	GeneralNotebookSubMenuParameters._browse_main(self)
	self.set_items([], 'options_auto_list')
	louie_send('remove_tv_button', sender=self)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa16002c>}
nname: 103
n 103(None)[]:
	i: 15(), 50(JA), 76(), 89()
	o: 

nname: 89
n 89(None)[Menu.focus_previous(self)
]:
	i: 23(f)
	o: 103()

nname: 76
n 76(None)[self.active_list = 'center_list'
]:
	i: 39(t)
	o: 103()

nname: 50
n 50(None)[log.debug('PREV with center hop')
self.active_list = 'main_list'
]:
	i: 39(f)
	o: 103(JA)

nname: 39
n 39(self['center_list'])[]:
	i: 23(t)
	o: 50(f), 76(t)

nname: 23
n 23(self.active_list in ('options_list', 'options_auto_list'))[]:
	i: 0(f)
	o: 39(t), 89(f)

nname: 15
n 15(None)[return False
]:
	i: 0(t)
	o: 103()

nname: 0
n 0(self.active_list == 'main_list')[]:
	i: 
	o: 15(t), 23(f)

nname: 0
n 0(None)[if self.active_list == 'main_list':
	return False
else:
	if self.active_list in ('options_list', 'options_auto_list'):
		if not self['center_list']:
			log.debug('PREV with center hop')
			self.active_list = 'main_list'
		else:
			self.active_list = 'center_list'
	else:
		Menu.focus_previous(self)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa16068c>}
nname: 101
n 101(None)[]:
	i: 75(), 87()
	o: 

nname: 87
n 87(None)[GeneralNotebookSubMenuParameters.focus_next(self)
]:
	i: 0&18(f)
	o: 101()

nname: 75
n 75(None)[self.active_list = 'options_auto_list'
]:
	i: 47(), 74()
	o: 101()

nname: 74
n 74(None)[]:
	i: 34(f)
	o: 75()

nname: 47
n 47(None)[self.browse_selected_task.stop()
self._browse_selected()
]:
	i: 34(t)
	o: 75()

nname: 34
n 34(self.browse_selected_task.running)[]:
	i: 0&18(t)
	o: 47(t), 74(f)

nname: 0&18
n 0&18(isinstance(self.selected_main, TNTScanMenuSetupItem) and self.active_list == 'main_list')[]:
	i: 
	o: 34(t), 87(f)

nname: 101
n 101(None)[]:
	i: 34(), 87()
	o: 

nname: 87
n 87(None)[GeneralNotebookSubMenuParameters.focus_next(self)
]:
	i: 0&18(f)
	o: 101()

nname: 34
n 34(None)[if self.browse_selected_task.running:
	self.browse_selected_task.stop()
	self._browse_selected()
self.active_list = 'options_auto_list'
]:
	i: 0&18(t)
	o: 101()

nname: 0&18
n 0&18(isinstance(self.selected_main, TNTScanMenuSetupItem) and self.active_list == 'main_list')[]:
	i: 
	o: 34(t), 87(f)

nname: 0&18
n 0&18(None)[if isinstance(self.selected_main, TNTScanMenuSetupItem) and self.active_list == 'main_list':
	if self.browse_selected_task.running:
		self.browse_selected_task.stop()
		self._browse_selected()
	self.active_list = 'options_auto_list'
else:
	GeneralNotebookSubMenuParameters.focus_next(self)
]:
	i: 
	o: 

self.nodes: {'0&18': <unpyclib.structure.node instance at 0xa16016c>}
nname: 0
n 0(None)[self.selected.display_type = 'checked'
self.focus_previous()
self.browse_selected()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa17058c>}
nname: 6
n 6(None)[def __init__(self, *args, **args):
	GeneralNotebookSubMenuParameters.__init__(self, browse_at_init=False, *args, **kw)
	self.available_choices = ['main_list', 'center_list', 'options_list', 'options_auto_list']
	self._getitems_keywords.update(dict(options_auto_list=(lambda : self.get_item_list('options_auto_list'))))
	self._browse_main()

def _browse_main(self):
	if isinstance(self.selected_main, TNTScanMenuSetupItem):
		try:
			content = self.selected_main.browse()
			louie_send('show_tv_button', sender=self)
		except AttributeError:
			log.debug('Center Item is not browseable')
			content = []
		self.set_items(content, 'options_auto_list')
		self.set_items([], 'options_list')
	else:
		GeneralNotebookSubMenuParameters._browse_main(self)
		self.set_items([], 'options_auto_list')
		louie_send('remove_tv_button', sender=self)

def focus_previous(self):
	if self.active_list == 'main_list':
		return False
	else:
		if self.active_list in ('options_list', 'options_auto_list'):
			if not self['center_list']:
				log.debug('PREV with center hop')
				self.active_list = 'main_list'
			else:
				self.active_list = 'center_list'
		else:
			Menu.focus_previous(self)

def focus_next(self):
	if isinstance(self.selected_main, TNTScanMenuSetupItem) and self.active_list == 'main_list':
		if self.browse_selected_task.running:
			self.browse_selected_task.stop()
			self._browse_selected()
		self.active_list = 'options_auto_list'
	else:
		GeneralNotebookSubMenuParameters.focus_next(self)

def _set_options_list(self, selection, keep_selection=False):
	self.selected.display_type = 'checked'
	self.focus_previous()
	self.browse_selected()

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xa170a6c>}
nname: 154
n 154(None)[]:
	i: 130(), 153()
	o: 

nname: 153
n 153(None)[]:
	i: 0(t)
	o: 154()

nname: 130
n 130(None)[self._display_explain = True
self._good_verif()
]:
	i: 0(f)
	o: 154()

nname: 0
n 0(verif_first)[SecretCodeCheckMenu.__init__(self, name, **kw)
self.main_items.append(SecretCodeUserConfigSetupItem(name='SecretCode', menu=self, domain='security', key='secretcode'))
self.prompt_items.append(Item(name=_('Enter your new code'), type_='unknown'))
self._current_action = self.main_items[0]
self._display_explain = False
]:
	i: 
	o: 130(f), 153(t)

nname: 0
n 0(None)[SecretCodeCheckMenu.__init__(self, name, **kw)
self.main_items.append(SecretCodeUserConfigSetupItem(name='SecretCode', menu=self, domain='security', key='secretcode'))
self.prompt_items.append(Item(name=_('Enter your new code'), type_='unknown'))
self._current_action = self.main_items[0]
self._display_explain = False
if not verif_first:
	self._display_explain = True
	self._good_verif()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa160a6c>}
nname: 0
n 0(None)[self._browse_items(1)
self._current_action = self.main_items[1]
self.active_list = 'main_list'
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa170fcc>}
nname: 167
n 167(None)[]:
	i: 28(JA), 75(JA), 97(), 153()
	o: 

nname: 153
n 153(None)[pygui_globs['menustack'].back_one_menu()
]:
	i: 132(), 152()
	o: 167()

nname: 152
n 152(None)[]:
	i: 122(f)
	o: 153()

nname: 132
n 132(None)[louie_send('secret_code_explain_off', sender=self)
]:
	i: 122(t)
	o: 153()

nname: 122
n 122(self._display_explain)[]:
	i: 0(f)
	o: 132(t), 152(f)

nname: 97
n 97(None)[self._browse_items(0)
self.active_list = 'main_list'
]:
	i: 46(), 95(AE)
	o: 167()

nname: 95
n 95(None)[]:
	i: 65(f)
	o: 97(AE)

nname: 75
n 75(None)[QuestionAnswerCheckLauncher(self._good_verif)
]:
	i: 65(t)
	o: 167(JA)

nname: 65
n 65(<dummy_ex3> EXC_MATCH IndexError)[]:
	i: 42(except)
	o: 75(t), 95(f)

nname: 46
n 46(None)[remain = self.countdown.pop()
]:
	i: 42(try)
	o: 97()

nname: 42
n 42(None)[]:
	i: 15(f)
	o: 46(try), 65(except)

nname: 28
n 28(None)[self._good_verif()
]:
	i: 15(t)
	o: 167(JA)

nname: 15
n 15(selection.check_entered_value())[]:
	i: 0(t)
	o: 28(t), 42(f)

nname: 0
n 0(isinstance(selection, SecretCodeCheckConfigSetupItem))[]:
	i: 
	o: 15(t), 122(f)

nname: 167
n 167(None)[]:
	i: 28(JA), 75(JA), 97(), 122(), 65(f)
	o: 

nname: 122
n 122(None)[if self._display_explain:
	louie_send('secret_code_explain_off', sender=self)
pygui_globs['menustack'].back_one_menu()
]:
	i: 0(f)
	o: 167()

nname: 75
n 75(None)[QuestionAnswerCheckLauncher(self._good_verif)
]:
	i: 65(t)
	o: 167(JA)

nname: 65
n 65(<dummy_ex3> EXC_MATCH IndexError)[]:
	i: 42(except)
	o: 75(t), 167(f)

nname: 97
n 97(None)[self._browse_items(0)
self.active_list = 'main_list'
]:
	i: 46(), 95(AE)
	o: 167()

nname: 46
n 46(None)[remain = self.countdown.pop()
]:
	i: 42(try)
	o: 97()

nname: 42
n 42(None)[]:
	i: 15(f)
	o: 46(try), 65(except)

nname: 28
n 28(None)[self._good_verif()
]:
	i: 15(t)
	o: 167(JA)

nname: 15
n 15(selection.check_entered_value())[]:
	i: 0(t)
	o: 28(t), 42(f)

nname: 0
n 0(isinstance(selection, SecretCodeCheckConfigSetupItem))[]:
	i: 
	o: 15(t), 122(f)

nname: 167
n 167(None)[]:
	i: 28(JA), 65(), 122()
	o: 

nname: 122
n 122(None)[if self._display_explain:
	louie_send('secret_code_explain_off', sender=self)
pygui_globs['menustack'].back_one_menu()
]:
	i: 0(f)
	o: 167()

nname: 65
n 65(None)[except IndexError:
	QuestionAnswerCheckLauncher(self._good_verif)
else:
	self._browse_items(0)
	self.active_list = 'main_list'
]:
	i: 42()
	o: 167()

nname: 42
n 42(None)[try:
	remain = self.countdown.pop()
]:
	i: 15(f)
	o: 65()

nname: 28
n 28(None)[self._good_verif()
]:
	i: 15(t)
	o: 167(JA)

nname: 15
n 15(selection.check_entered_value())[]:
	i: 0(t)
	o: 28(t), 42(f)

nname: 0
n 0(isinstance(selection, SecretCodeCheckConfigSetupItem))[]:
	i: 
	o: 15(t), 122(f)

nname: 167
n 167(None)[]:
	i: 28(JA), 42(), 122()
	o: 

nname: 122
n 122(None)[if self._display_explain:
	louie_send('secret_code_explain_off', sender=self)
pygui_globs['menustack'].back_one_menu()
]:
	i: 0(f)
	o: 167()

nname: 42
n 42(None)[try:
	remain = self.countdown.pop()
except IndexError:
	QuestionAnswerCheckLauncher(self._good_verif)
else:
	self._browse_items(0)
	self.active_list = 'main_list'
]:
	i: 15(f)
	o: 167()

nname: 28
n 28(None)[self._good_verif()
]:
	i: 15(t)
	o: 167(JA)

nname: 15
n 15(selection.check_entered_value())[]:
	i: 0(t)
	o: 28(t), 42(f)

nname: 0
n 0(isinstance(selection, SecretCodeCheckConfigSetupItem))[]:
	i: 
	o: 15(t), 122(f)

nname: 0
n 0(None)[if isinstance(selection, SecretCodeCheckConfigSetupItem):
	if selection.check_entered_value():
		self._good_verif()
	else:
		try:
			remain = self.countdown.pop()
		except IndexError:
			QuestionAnswerCheckLauncher(self._good_verif)
		else:
			self._browse_items(0)
			self.active_list = 'main_list'
else:
	if self._display_explain:
		louie_send('secret_code_explain_off', sender=self)
	pygui_globs['menustack'].back_one_menu()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa16092c>}
nname: 40
n 40(None)[]:
	i: 22(), 39()
	o: 

nname: 39
n 39(None)[]:
	i: 0(f)
	o: 40()

nname: 22
n 22(None)[SecretCodeCheckMenu.cancel(self)
]:
	i: 0(t)
	o: 40()

nname: 0
n 0(self._current_action is self.main_items[0])[]:
	i: 
	o: 22(t), 39(f)

nname: 0
n 0(None)[if self._current_action is self.main_items[0]:
	SecretCodeCheckMenu.cancel(self)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa15e9ac>}
nname: 46
n 46(None)[]:
	i: 25(), 45()
	o: 

nname: 45
n 45(None)[]:
	i: 0(f)
	o: 46()

nname: 25
n 25(None)[louie_send('secret_code_explain_on', sender=self)
]:
	i: 0(t)
	o: 46()

nname: 0
n 0(self._display_explain)[SecretCodeCheckMenu.show(self, hide_previous_menu)
]:
	i: 
	o: 25(t), 45(f)

nname: 0
n 0(None)[SecretCodeCheckMenu.show(self, hide_previous_menu)
if self._display_explain:
	louie_send('secret_code_explain_on', sender=self)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa15ef0c>}
nname: 6
n 6(None)[__doc__ = '\n    This Menu adds new secret code capture capability to the SecretCodeCheckMenu.\n    This appends after checking that user knows the cuurent secret code\n    '
def __init__(self, name, verif_first=True, eventhandler=None, **kw):
	SecretCodeCheckMenu.__init__(self, name, **kw)
	self.main_items.append(SecretCodeUserConfigSetupItem(name='SecretCode', menu=self, domain='security', key='secretcode'))
	self.prompt_items.append(Item(name=_('Enter your new code'), type_='unknown'))
	self._current_action = self.main_items[0]
	self._display_explain = False
	if not verif_first:
		self._display_explain = True
		self._good_verif()

def _good_verif(self):
	self._browse_items(1)
	self._current_action = self.main_items[1]
	self.active_list = 'main_list'

def _set_options_list(self, selection, keep_selection=False):
	if isinstance(selection, SecretCodeCheckConfigSetupItem):
		if selection.check_entered_value():
			self._good_verif()
		else:
			try:
				remain = self.countdown.pop()
			except IndexError:
				QuestionAnswerCheckLauncher(self._good_verif)
			else:
				self._browse_items(0)
				self.active_list = 'main_list'
	else:
		if self._display_explain:
			louie_send('secret_code_explain_off', sender=self)
		pygui_globs['menustack'].back_one_menu()

def cancel(self):
	if self._current_action is self.main_items[0]:
		SecretCodeCheckMenu.cancel(self)

def show(self, hide_previous_menu=False):
	SecretCodeCheckMenu.show(self, hide_previous_menu)
	if self._display_explain:
		louie_send('secret_code_explain_on', sender=self)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xa170c0c>}
nname: 0
n 0(None)[return (TVNotebookSubMenuParameters, dict(name=_('TV'), type='notebook_setup_tv'))
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa170eac>}
nname: 733
n 733(None)[]:
	i: 706(), 726()
	o: 

nname: 726
n 726(None)[TNTScanMenuSetupItem = None
]:
	i: 468(f)
	o: 733()

nname: 706
n 706(None)[from pygui.item.parameters.tv.tvsetup import TNTScanMenuSetupItem
]:
	i: 468(t)
	o: 733()

nname: 468
n 468('tv' in plugins)[class MainSetupParametersNotebookMenu(NotebookMenu):
	universe = 'setup'
	lazy_selection_delay = 1
	def __init__(self, name, **kw):
		self.parameters_items = []
		self.parameters_menus = []
		self.parameters_args = []
		self.type = kw['type']
		self._root_getter()
		self.eventhandler = HorizontalNotebookMenuEventHandler(self)
		NotebookMenu.__init__(self, name=name, choices=self.parameters_items, submenus=self.parameters_menus, subargs=self.parameters_args, subpos=-2, **kw)
		self.set_items(self.parameters_items)
		self.refresh_network_task = Task(self._refresh_network)
		self.refresh_network_task.delay = 1
		self.refresh_network = self.refresh_network_task.start
		self.wn = WyNetwork()
		self.wn.wn_dev.attach(self)
		self.wn.wn_gen.attach(self)
		def _network_text():
			status = _('Disconnected')
			try:
				pass
			if self.wn.wn_gen.isConnected():
				for dev in self.wn.wn_dev.getDevices():
					dev_infos = self.wn.wn_dev.getDeviceInfos(dev)
					if dev_infos['active'] == 'true':
						if dev_infos['networkType'] == '802.11':
							pass
						status = _('Ethernet network')
						break
						continue

		def _network_icon():
			if self.wn.wn_gen.isConnected() and self.wn.wn_cfg.getActiveConfigurationInfos()['networkType'] != '802.3':
				return 'network_icon_wireless_selected.png'
			return 'network_icon_wired_selected.png'

		def _connection_text():
			if user_config['connections']['active_device'] == 'hdmi':
				current_connection = hdmiresolution_dict.get(user_config['connections']['resolution'], _('N/A'))
			else:
				current_connection = user_config['connections']['composite_output']
				current_connection = str(current_connection).upper()
			return current_connection

		self._getitems_keywords.update(dict(space_available=(lambda : _('%(size)s available space') % {'size': get_free_available_space('/wymedia')}), space_total=(lambda : _('%(size)s total space') % {'size': get_space('/wymedia')}), network=_network_text, network_icon=_network_icon, connection=_connection_text, universe_name=(lambda : UNIVERSE_NAME_DICT[self.type]), clock=(lambda : None)))
		louie_connect(self.connection_switched, 'connection_switched')

	def _root_getter(self):
		pass

	def refresh_connection(self, value):
		louie_send('connection', sender=self, value=value)

	def connection_switched(self, signal):
		self.refresh_connection(self['connection'])

	def _refresh_network(self):
		net_name = self['network']
		net_icon = self['network_icon']
		louie_send('network', sender=self, value=net_name)
		louie_send('network_icon', sender=self, value=net_icon)

	def on_modify_lang(self):
		stack = pygui_globs['menustack']

	def stop(self):
		self.wn.wn_gen.detach(self)
		louie_disconnect(self.connection_switched, 'connection_switched')
		NotebookMenu.stop(self)

	def onConnected(self):
		self.refresh_network()

	def onDisconnected(self):
		self.refresh_network()

	def onDeviceConnected(self, device):
		self.refresh_network()

	def onDeviceDisconnected(self, device):
		self.refresh_network()



class GeneralNotebookSubMenuParameters(NotebookSubMenu):
	__doc__ = "\n    Menu related to page 'General', 'Photo/Video', 'Connections'\n    "
	universe = 'setup'
	def __init__(self, browse_at_init=True, *args, **args):
		self.eventhandler = ParametersSubMenuEventHandler(self)
		NotebookSubMenu.__init__(self, *args, **kw)
		self.available_choices = ['main_list', 'center_list', 'options_list']
		self._getitems_keywords.update(dict(center_list=(lambda : self.get_item_list('center_list')), options_list=(lambda : self.get_item_list('options_list'))))
		if browse_at_init:
			self._browse_main()
		self.browse_selected_task = Task(self._browse_selected)
		self.browse_selected_task.delay = 0.5
		self.browse_selected = self.browse_selected_task.start

	def _set_main(self, value):
		item_list = self.get_item_list('main_list')
		item_list.select(value)

	def _get_main(self):
		item_list = self.get_item_list('main_list')
		if not item_list.selected:
			pass
		ret = item_list.selected
		return ret

	selected_main = property(_get_main, _set_main)
	del _get_main
	del _set_main
	def _set_center(self, value):
		item_list = self.get_item_list('center_list')
		item_list.select(value)

	def _get_center(self):
		item_list = self.get_item_list('center_list')
		if not item_list.selected:
			pass
		ret = item_list.selected
		return ret

	selected_center = property(_get_center, _set_center)
	del _get_center
	del _set_center
	def _set_options(self, value):
		item_list = self.get_item_list('options_list')
		item_list.select(value)

	def _get_options(self):
		item_list = self.get_item_list('options_list')
		if not item_list.selected:
			pass
		ret = item_list.selected
		return ret

	selected_options = property(_get_options, _set_options)
	del _get_options
	del _set_options
	def _browse_main(self):
		if not self.selected_main:
			pass
		item_top = self.selected_main
		if hasattr(item_top, 'depth'):
			if item_top.depth == 2:
				self.set_items([], 'center_list')
				self.set_items(item_top.browse(), 'options_list')
			if item_top.depth == 3:
				self.set_items(item_top.browse(), 'center_list')
				self._browse_center()
		else:
			self.set_items([], 'center_list')
			self.set_items([], 'options_list')

	def _browse_center(self):
		try:
			content = self.selected_center.browse()
		except AttributeError:
			log.debug('Center Item is not browseable')
			content = []
		self.set_items(content, 'options_list')

	def _browse_selected(self):
		switch = {'main_list': self._browse_main, 'center_list': self._browse_center}
		switch.get(self.active_list, (lambda : None))()

	def focus_next(self):
		if self.browse_selected_task.running:
			self.browse_selected_task.stop()
			self._browse_selected()
		if self.active_list == 'main_list' and not self['center_list']:
			log.debug('NEXT with center hop')
			self.active_list = 'options_list'
		else:
			log.debug('NEXT without center hop')
			Menu.focus_next(self)

	def focus_previous(self):
		if self.active_list == 'main_list':
			return False
		else:
			if self.active_list == 'options_list' and not self['center_list']:
				log.debug('PREV with center hop')
				self.active_list = 'main_list'
			else:
				Menu.focus_previous(self)

	def _set_options_list(self, selection, keep_selection=False):
		self.selected.display_type = 'checked'
		self.focus_previous()
		self.browse_selected()



class GeneralConfigNotebookSubMenuParameters(GeneralNotebookSubMenuParameters):
	def __init__(self, *args, **args):
		self.first_parental = False
		self._secret_code_launched = False
		GeneralNotebookSubMenuParameters.__init__(self, *args, **kw)

	def on_first_parental_control(self):
		user_config['security']['parental_control'] = False
		user_config.save()
		SecretCodeSetupParametersMenu(name='', verif_first=False).show()
		self._secret_code_launched = True

	def reload_func(self):
		if self._secret_code_launched and user_config['security']['secretcode'] is not None:
			self._secret_code_value = user_config['security']['secretcode']
			user_config['security']['secretcode'] = None
			user_config.save()
			def _set_parental_ok():
				user_config['security']['parental_control'] = True
				user_config['security']['secretcode'] = self._secret_code_value
				user_config.save()
				self.end_func()
				self.first_parental = False

			self._secret_code_launched = False
			QuestionAnswerSetupParametersLauncher(check=False, end_action=_set_parental_ok)
		return None



class ConnectionsNotebookSubMenuParameters(GeneralNotebookSubMenuParameters):
	def __init__(self, *args, **args):
		GeneralNotebookSubMenuParameters.__init__(self, browse_at_init=False, *args, **kw)
		self.available_choices = ['main_list', 'center_list', 'options_list', 'aspect_ratio_options_list']
		self._getitems_keywords.update(dict(aspect_ratio_options_list=(lambda : self.get_item_list('aspect_ratio_options_list'))))
		self._browse_main()

	def _browse_main(self):
		if isinstance(self.selected_main, AspectRatioParametersSetupItem):
			try:
				content = self.selected_main.browse()
			except AttributeError:
				log.debug('Center Item is not browseable')
				content = []
			self.set_items(content, 'aspect_ratio_options_list')
			self.set_items([], 'options_list')
		else:
			GeneralNotebookSubMenuParameters._browse_main(self)
			self.set_items([], 'aspect_ratio_options_list')

	def focus_next(self):
		if isinstance(self.selected_main, AspectRatioParametersSetupItem) and self.active_list == 'main_list':
			if self.browse_selected_task.running:
				self.browse_selected_task.stop()
				self._browse_selected()
			self.active_list = 'aspect_ratio_options_list'
		else:
			GeneralNotebookSubMenuParameters.focus_next(self)

	def focus_previous(self):
		if self.active_list == 'main_list':
			return False
		else:
			if self.active_list in ('options_list', 'aspect_ratio_options_list'):
				self.active_list = 'main_list'
			else:
				GeneralNotebookSubMenuParameters.focus_previous(self)

	def _set_options_list(self, selection, keep_selection=False):
		self.selected.display_type = 'checked'
		self.focus_previous()
		self.browse_selected()



class AdvancedNotebookSubMenuParameters(GeneralNotebookSubMenuParameters):
	def focus_next(self):
		from pygui.item.parameters.advanced.advancedsetup import ReInitBoxItem
		if isinstance(self.selected, ReInitBoxItem):
			return False
		else:
			GeneralNotebookSubMenuParameters.focus_next(self)



class VersionNotebookSubMenuParameters(NotebookSubMenu):
	universe = 'setup'
	def __init__(self, *args, **args):
		self.eventhandler = ParametersSubMenuEventHandler(self)
		NotebookSubMenu.__init__(self, *args, **kw)

	def focus_next(self):
		return False

	focus_previous = focus_next
	def browse_selected(self):
		return None



class NetworkNotebookSubMenuParameters(GeneralNotebookSubMenuParameters):
	def _browse_main(self):
		from pygui.item.parameters.network.networksetup import StatusNetworkConfSetupItem
		GeneralNotebookSubMenuParameters._browse_main(self)
		if isinstance(self.selected, StatusNetworkConfSetupItem):
			self['options_list'].selected = None
		return None

	def focus_previous(self):
		return False

	def focus_next(self):
		return False



class TVNotebookSubMenuParameters(GeneralNotebookSubMenuParameters):
	def __init__(self, *args, **args):
		GeneralNotebookSubMenuParameters.__init__(self, browse_at_init=False, *args, **kw)
		self.available_choices = ['main_list', 'center_list', 'options_list', 'options_auto_list']
		self._getitems_keywords.update(dict(options_auto_list=(lambda : self.get_item_list('options_auto_list'))))
		self._browse_main()

	def _browse_main(self):
		if isinstance(self.selected_main, TNTScanMenuSetupItem):
			try:
				content = self.selected_main.browse()
				louie_send('show_tv_button', sender=self)
			except AttributeError:
				log.debug('Center Item is not browseable')
				content = []
			self.set_items(content, 'options_auto_list')
			self.set_items([], 'options_list')
		else:
			GeneralNotebookSubMenuParameters._browse_main(self)
			self.set_items([], 'options_auto_list')
			louie_send('remove_tv_button', sender=self)

	def focus_previous(self):
		if self.active_list == 'main_list':
			return False
		else:
			if self.active_list in ('options_list', 'options_auto_list'):
				if not self['center_list']:
					log.debug('PREV with center hop')
					self.active_list = 'main_list'
				else:
					self.active_list = 'center_list'
			else:
				Menu.focus_previous(self)

	def focus_next(self):
		if isinstance(self.selected_main, TNTScanMenuSetupItem) and self.active_list == 'main_list':
			if self.browse_selected_task.running:
				self.browse_selected_task.stop()
				self._browse_selected()
			self.active_list = 'options_auto_list'
		else:
			GeneralNotebookSubMenuParameters.focus_next(self)

	def _set_options_list(self, selection, keep_selection=False):
		self.selected.display_type = 'checked'
		self.focus_previous()
		self.browse_selected()



from .security import SecretCodeCheckMenu, QuestionAnswerCheckLauncher, QuestionAnswerSetupParametersLauncher
class SecretCodeSetupParametersMenu(SecretCodeCheckMenu):
	__doc__ = '\n    This Menu adds new secret code capture capability to the SecretCodeCheckMenu.\n    This appends after checking that user knows the cuurent secret code\n    '
	def __init__(self, name, verif_first=True, eventhandler=None, **kw):
		SecretCodeCheckMenu.__init__(self, name, **kw)
		self.main_items.append(SecretCodeUserConfigSetupItem(name='SecretCode', menu=self, domain='security', key='secretcode'))
		self.prompt_items.append(Item(name=_('Enter your new code'), type_='unknown'))
		self._current_action = self.main_items[0]
		self._display_explain = False
		if not verif_first:
			self._display_explain = True
			self._good_verif()

	def _good_verif(self):
		self._browse_items(1)
		self._current_action = self.main_items[1]
		self.active_list = 'main_list'

	def _set_options_list(self, selection, keep_selection=False):
		if isinstance(selection, SecretCodeCheckConfigSetupItem):
			if selection.check_entered_value():
				self._good_verif()
			else:
				try:
					remain = self.countdown.pop()
				except IndexError:
					QuestionAnswerCheckLauncher(self._good_verif)
				else:
					self._browse_items(0)
					self.active_list = 'main_list'
		else:
			if self._display_explain:
				louie_send('secret_code_explain_off', sender=self)
			pygui_globs['menustack'].back_one_menu()

	def cancel(self):
		if self._current_action is self.main_items[0]:
			SecretCodeCheckMenu.cancel(self)

	def show(self, hide_previous_menu=False):
		SecretCodeCheckMenu.show(self, hide_previous_menu)
		if self._display_explain:
			louie_send('secret_code_explain_on', sender=self)



]:
	i: 450(), 467()
	o: 706(t), 726(f)

nname: 467
n 467(None)[]:
	i: 0(f)
	o: 468()

nname: 450
n 450(None)[def _submenus_dict['tv']():
	return (TVNotebookSubMenuParameters, dict(name=_('TV'), type='notebook_setup_tv'))

]:
	i: 0(t)
	o: 468()

nname: 0
n 0('tv' in plugins)[from __future__ import absolute_import
from time import time
from .core import Menu
from peewee.debug import GET_LOGGER, PRINT_EXCEPTION
from peewee.notifier import Task
from peewee.system import get_free_available_space, get_space
from wynetwork.utils import WyNetwork
from pygui.config import plugins, user_config
from pygui.facilities.codemapping import hdmiresolution_dict
from pygui.facilities.l10n import get_date_format, get_time_format
from pygui.item.core import Item
from pygui.shared import pygui_globs
from pygui.eventmanager.menus import HorizontalNotebookMenuEventHandler, ParametersSubMenuEventHandler, SecretCodeMenuEventHandler
from pygui.item.parameters.generalsetup.securitysetup import SecretCodeUserConfigSetupItem, SecretCodeCheckConfigSetupItem
from pygui.item.parameters.videophoto.video import AspectRatioParametersSetupItem
from pygui.menu import UNIVERSE_NAME_DICT
from pygui.menu.menu.notebook import NotebookMenu, NotebookSubMenu
from peewee.messages import send as louie_send, connect as louie_connect, disconnect as louie_disconnect
log = GET_LOGGER(__name__)
_submenus_dict = {'generalsetup': (lambda : (GeneralConfigNotebookSubMenuParameters, dict(name=_('General'), type='notebook_setup_general'))), 'videophoto': (lambda : (GeneralNotebookSubMenuParameters, dict(name=_('Video/Photo'), type='notebook_setup_videophoto'))), 'connections': (lambda : (ConnectionsNotebookSubMenuParameters, dict(name=_('Connection'), type='notebook_setup_connections'))), 'network': (lambda : (NetworkNotebookSubMenuParameters, dict(name=_('General'), type='notebook_setup_network'))), 'advanced': (lambda : (AdvancedNotebookSubMenuParameters, dict(name=_('Advanced'), type='notebook_setup_advanced'))), 'version': (lambda : (VersionNotebookSubMenuParameters, dict(name=_('Version'), type='notebook_setup_version')))}
]:
	i: 
	o: 450(t), 467(f)

nname: 733
n 733(None)[]:
	i: 0()
	o: 

nname: 0
n 0(None)[from __future__ import absolute_import
from time import time
from .core import Menu
from peewee.debug import GET_LOGGER, PRINT_EXCEPTION
from peewee.notifier import Task
from peewee.system import get_free_available_space, get_space
from wynetwork.utils import WyNetwork
from pygui.config import plugins, user_config
from pygui.facilities.codemapping import hdmiresolution_dict
from pygui.facilities.l10n import get_date_format, get_time_format
from pygui.item.core import Item
from pygui.shared import pygui_globs
from pygui.eventmanager.menus import HorizontalNotebookMenuEventHandler, ParametersSubMenuEventHandler, SecretCodeMenuEventHandler
from pygui.item.parameters.generalsetup.securitysetup import SecretCodeUserConfigSetupItem, SecretCodeCheckConfigSetupItem
from pygui.item.parameters.videophoto.video import AspectRatioParametersSetupItem
from pygui.menu import UNIVERSE_NAME_DICT
from pygui.menu.menu.notebook import NotebookMenu, NotebookSubMenu
from peewee.messages import send as louie_send, connect as louie_connect, disconnect as louie_disconnect
log = GET_LOGGER(__name__)
_submenus_dict = {'generalsetup': (lambda : (GeneralConfigNotebookSubMenuParameters, dict(name=_('General'), type='notebook_setup_general'))), 'videophoto': (lambda : (GeneralNotebookSubMenuParameters, dict(name=_('Video/Photo'), type='notebook_setup_videophoto'))), 'connections': (lambda : (ConnectionsNotebookSubMenuParameters, dict(name=_('Connection'), type='notebook_setup_connections'))), 'network': (lambda : (NetworkNotebookSubMenuParameters, dict(name=_('General'), type='notebook_setup_network'))), 'advanced': (lambda : (AdvancedNotebookSubMenuParameters, dict(name=_('Advanced'), type='notebook_setup_advanced'))), 'version': (lambda : (VersionNotebookSubMenuParameters, dict(name=_('Version'), type='notebook_setup_version')))}
if 'tv' in plugins:
	def _submenus_dict['tv']():
		return (TVNotebookSubMenuParameters, dict(name=_('TV'), type='notebook_setup_tv'))

class MainSetupParametersNotebookMenu(NotebookMenu):
	universe = 'setup'
	lazy_selection_delay = 1
	def __init__(self, name, **kw):
		self.parameters_items = []
		self.parameters_menus = []
		self.parameters_args = []
		self.type = kw['type']
		self._root_getter()
		self.eventhandler = HorizontalNotebookMenuEventHandler(self)
		NotebookMenu.__init__(self, name=name, choices=self.parameters_items, submenus=self.parameters_menus, subargs=self.parameters_args, subpos=-2, **kw)
		self.set_items(self.parameters_items)
		self.refresh_network_task = Task(self._refresh_network)
		self.refresh_network_task.delay = 1
		self.refresh_network = self.refresh_network_task.start
		self.wn = WyNetwork()
		self.wn.wn_dev.attach(self)
		self.wn.wn_gen.attach(self)
		def _network_text():
			status = _('Disconnected')
			try:
				pass
			if self.wn.wn_gen.isConnected():
				for dev in self.wn.wn_dev.getDevices():
					dev_infos = self.wn.wn_dev.getDeviceInfos(dev)
					if dev_infos['active'] == 'true':
						if dev_infos['networkType'] == '802.11':
							pass
						status = _('Ethernet network')
						break
						continue

		def _network_icon():
			if self.wn.wn_gen.isConnected() and self.wn.wn_cfg.getActiveConfigurationInfos()['networkType'] != '802.3':
				return 'network_icon_wireless_selected.png'
			return 'network_icon_wired_selected.png'

		def _connection_text():
			if user_config['connections']['active_device'] == 'hdmi':
				current_connection = hdmiresolution_dict.get(user_config['connections']['resolution'], _('N/A'))
			else:
				current_connection = user_config['connections']['composite_output']
				current_connection = str(current_connection).upper()
			return current_connection

		self._getitems_keywords.update(dict(space_available=(lambda : _('%(size)s available space') % {'size': get_free_available_space('/wymedia')}), space_total=(lambda : _('%(size)s total space') % {'size': get_space('/wymedia')}), network=_network_text, network_icon=_network_icon, connection=_connection_text, universe_name=(lambda : UNIVERSE_NAME_DICT[self.type]), clock=(lambda : None)))
		louie_connect(self.connection_switched, 'connection_switched')

	def _root_getter(self):
		pass

	def refresh_connection(self, value):
		louie_send('connection', sender=self, value=value)

	def connection_switched(self, signal):
		self.refresh_connection(self['connection'])

	def _refresh_network(self):
		net_name = self['network']
		net_icon = self['network_icon']
		louie_send('network', sender=self, value=net_name)
		louie_send('network_icon', sender=self, value=net_icon)

	def on_modify_lang(self):
		stack = pygui_globs['menustack']

	def stop(self):
		self.wn.wn_gen.detach(self)
		louie_disconnect(self.connection_switched, 'connection_switched')
		NotebookMenu.stop(self)

	def onConnected(self):
		self.refresh_network()

	def onDisconnected(self):
		self.refresh_network()

	def onDeviceConnected(self, device):
		self.refresh_network()

	def onDeviceDisconnected(self, device):
		self.refresh_network()



class GeneralNotebookSubMenuParameters(NotebookSubMenu):
	__doc__ = "\n    Menu related to page 'General', 'Photo/Video', 'Connections'\n    "
	universe = 'setup'
	def __init__(self, browse_at_init=True, *args, **args):
		self.eventhandler = ParametersSubMenuEventHandler(self)
		NotebookSubMenu.__init__(self, *args, **kw)
		self.available_choices = ['main_list', 'center_list', 'options_list']
		self._getitems_keywords.update(dict(center_list=(lambda : self.get_item_list('center_list')), options_list=(lambda : self.get_item_list('options_list'))))
		if browse_at_init:
			self._browse_main()
		self.browse_selected_task = Task(self._browse_selected)
		self.browse_selected_task.delay = 0.5
		self.browse_selected = self.browse_selected_task.start

	def _set_main(self, value):
		item_list = self.get_item_list('main_list')
		item_list.select(value)

	def _get_main(self):
		item_list = self.get_item_list('main_list')
		if not item_list.selected:
			pass
		ret = item_list.selected
		return ret

	selected_main = property(_get_main, _set_main)
	del _get_main
	del _set_main
	def _set_center(self, value):
		item_list = self.get_item_list('center_list')
		item_list.select(value)

	def _get_center(self):
		item_list = self.get_item_list('center_list')
		if not item_list.selected:
			pass
		ret = item_list.selected
		return ret

	selected_center = property(_get_center, _set_center)
	del _get_center
	del _set_center
	def _set_options(self, value):
		item_list = self.get_item_list('options_list')
		item_list.select(value)

	def _get_options(self):
		item_list = self.get_item_list('options_list')
		if not item_list.selected:
			pass
		ret = item_list.selected
		return ret

	selected_options = property(_get_options, _set_options)
	del _get_options
	del _set_options
	def _browse_main(self):
		if not self.selected_main:
			pass
		item_top = self.selected_main
		if hasattr(item_top, 'depth'):
			if item_top.depth == 2:
				self.set_items([], 'center_list')
				self.set_items(item_top.browse(), 'options_list')
			if item_top.depth == 3:
				self.set_items(item_top.browse(), 'center_list')
				self._browse_center()
		else:
			self.set_items([], 'center_list')
			self.set_items([], 'options_list')

	def _browse_center(self):
		try:
			content = self.selected_center.browse()
		except AttributeError:
			log.debug('Center Item is not browseable')
			content = []
		self.set_items(content, 'options_list')

	def _browse_selected(self):
		switch = {'main_list': self._browse_main, 'center_list': self._browse_center}
		switch.get(self.active_list, (lambda : None))()

	def focus_next(self):
		if self.browse_selected_task.running:
			self.browse_selected_task.stop()
			self._browse_selected()
		if self.active_list == 'main_list' and not self['center_list']:
			log.debug('NEXT with center hop')
			self.active_list = 'options_list'
		else:
			log.debug('NEXT without center hop')
			Menu.focus_next(self)

	def focus_previous(self):
		if self.active_list == 'main_list':
			return False
		else:
			if self.active_list == 'options_list' and not self['center_list']:
				log.debug('PREV with center hop')
				self.active_list = 'main_list'
			else:
				Menu.focus_previous(self)

	def _set_options_list(self, selection, keep_selection=False):
		self.selected.display_type = 'checked'
		self.focus_previous()
		self.browse_selected()



class GeneralConfigNotebookSubMenuParameters(GeneralNotebookSubMenuParameters):
	def __init__(self, *args, **args):
		self.first_parental = False
		self._secret_code_launched = False
		GeneralNotebookSubMenuParameters.__init__(self, *args, **kw)

	def on_first_parental_control(self):
		user_config['security']['parental_control'] = False
		user_config.save()
		SecretCodeSetupParametersMenu(name='', verif_first=False).show()
		self._secret_code_launched = True

	def reload_func(self):
		if self._secret_code_launched and user_config['security']['secretcode'] is not None:
			self._secret_code_value = user_config['security']['secretcode']
			user_config['security']['secretcode'] = None
			user_config.save()
			def _set_parental_ok():
				user_config['security']['parental_control'] = True
				user_config['security']['secretcode'] = self._secret_code_value
				user_config.save()
				self.end_func()
				self.first_parental = False

			self._secret_code_launched = False
			QuestionAnswerSetupParametersLauncher(check=False, end_action=_set_parental_ok)
		return None



class ConnectionsNotebookSubMenuParameters(GeneralNotebookSubMenuParameters):
	def __init__(self, *args, **args):
		GeneralNotebookSubMenuParameters.__init__(self, browse_at_init=False, *args, **kw)
		self.available_choices = ['main_list', 'center_list', 'options_list', 'aspect_ratio_options_list']
		self._getitems_keywords.update(dict(aspect_ratio_options_list=(lambda : self.get_item_list('aspect_ratio_options_list'))))
		self._browse_main()

	def _browse_main(self):
		if isinstance(self.selected_main, AspectRatioParametersSetupItem):
			try:
				content = self.selected_main.browse()
			except AttributeError:
				log.debug('Center Item is not browseable')
				content = []
			self.set_items(content, 'aspect_ratio_options_list')
			self.set_items([], 'options_list')
		else:
			GeneralNotebookSubMenuParameters._browse_main(self)
			self.set_items([], 'aspect_ratio_options_list')

	def focus_next(self):
		if isinstance(self.selected_main, AspectRatioParametersSetupItem) and self.active_list == 'main_list':
			if self.browse_selected_task.running:
				self.browse_selected_task.stop()
				self._browse_selected()
			self.active_list = 'aspect_ratio_options_list'
		else:
			GeneralNotebookSubMenuParameters.focus_next(self)

	def focus_previous(self):
		if self.active_list == 'main_list':
			return False
		else:
			if self.active_list in ('options_list', 'aspect_ratio_options_list'):
				self.active_list = 'main_list'
			else:
				GeneralNotebookSubMenuParameters.focus_previous(self)

	def _set_options_list(self, selection, keep_selection=False):
		self.selected.display_type = 'checked'
		self.focus_previous()
		self.browse_selected()



class AdvancedNotebookSubMenuParameters(GeneralNotebookSubMenuParameters):
	def focus_next(self):
		from pygui.item.parameters.advanced.advancedsetup import ReInitBoxItem
		if isinstance(self.selected, ReInitBoxItem):
			return False
		else:
			GeneralNotebookSubMenuParameters.focus_next(self)



class VersionNotebookSubMenuParameters(NotebookSubMenu):
	universe = 'setup'
	def __init__(self, *args, **args):
		self.eventhandler = ParametersSubMenuEventHandler(self)
		NotebookSubMenu.__init__(self, *args, **kw)

	def focus_next(self):
		return False

	focus_previous = focus_next
	def browse_selected(self):
		return None



class NetworkNotebookSubMenuParameters(GeneralNotebookSubMenuParameters):
	def _browse_main(self):
		from pygui.item.parameters.network.networksetup import StatusNetworkConfSetupItem
		GeneralNotebookSubMenuParameters._browse_main(self)
		if isinstance(self.selected, StatusNetworkConfSetupItem):
			self['options_list'].selected = None
		return None

	def focus_previous(self):
		return False

	def focus_next(self):
		return False



class TVNotebookSubMenuParameters(GeneralNotebookSubMenuParameters):
	def __init__(self, *args, **args):
		GeneralNotebookSubMenuParameters.__init__(self, browse_at_init=False, *args, **kw)
		self.available_choices = ['main_list', 'center_list', 'options_list', 'options_auto_list']
		self._getitems_keywords.update(dict(options_auto_list=(lambda : self.get_item_list('options_auto_list'))))
		self._browse_main()

	def _browse_main(self):
		if isinstance(self.selected_main, TNTScanMenuSetupItem):
			try:
				content = self.selected_main.browse()
				louie_send('show_tv_button', sender=self)
			except AttributeError:
				log.debug('Center Item is not browseable')
				content = []
			self.set_items(content, 'options_auto_list')
			self.set_items([], 'options_list')
		else:
			GeneralNotebookSubMenuParameters._browse_main(self)
			self.set_items([], 'options_auto_list')
			louie_send('remove_tv_button', sender=self)

	def focus_previous(self):
		if self.active_list == 'main_list':
			return False
		else:
			if self.active_list in ('options_list', 'options_auto_list'):
				if not self['center_list']:
					log.debug('PREV with center hop')
					self.active_list = 'main_list'
				else:
					self.active_list = 'center_list'
			else:
				Menu.focus_previous(self)

	def focus_next(self):
		if isinstance(self.selected_main, TNTScanMenuSetupItem) and self.active_list == 'main_list':
			if self.browse_selected_task.running:
				self.browse_selected_task.stop()
				self._browse_selected()
			self.active_list = 'options_auto_list'
		else:
			GeneralNotebookSubMenuParameters.focus_next(self)

	def _set_options_list(self, selection, keep_selection=False):
		self.selected.display_type = 'checked'
		self.focus_previous()
		self.browse_selected()



from .security import SecretCodeCheckMenu, QuestionAnswerCheckLauncher, QuestionAnswerSetupParametersLauncher
class SecretCodeSetupParametersMenu(SecretCodeCheckMenu):
	__doc__ = '\n    This Menu adds new secret code capture capability to the SecretCodeCheckMenu.\n    This appends after checking that user knows the cuurent secret code\n    '
	def __init__(self, name, verif_first=True, eventhandler=None, **kw):
		SecretCodeCheckMenu.__init__(self, name, **kw)
		self.main_items.append(SecretCodeUserConfigSetupItem(name='SecretCode', menu=self, domain='security', key='secretcode'))
		self.prompt_items.append(Item(name=_('Enter your new code'), type_='unknown'))
		self._current_action = self.main_items[0]
		self._display_explain = False
		if not verif_first:
			self._display_explain = True
			self._good_verif()

	def _good_verif(self):
		self._browse_items(1)
		self._current_action = self.main_items[1]
		self.active_list = 'main_list'

	def _set_options_list(self, selection, keep_selection=False):
		if isinstance(selection, SecretCodeCheckConfigSetupItem):
			if selection.check_entered_value():
				self._good_verif()
			else:
				try:
					remain = self.countdown.pop()
				except IndexError:
					QuestionAnswerCheckLauncher(self._good_verif)
				else:
					self._browse_items(0)
					self.active_list = 'main_list'
		else:
			if self._display_explain:
				louie_send('secret_code_explain_off', sender=self)
			pygui_globs['menustack'].back_one_menu()

	def cancel(self):
		if self._current_action is self.main_items[0]:
			SecretCodeCheckMenu.cancel(self)

	def show(self, hide_previous_menu=False):
		SecretCodeCheckMenu.show(self, hide_previous_menu)
		if self._display_explain:
			louie_send('secret_code_explain_on', sender=self)



if 'tv' in plugins:
	from pygui.item.parameters.tv.tvsetup import TNTScanMenuSetupItem
else:
	TNTScanMenuSetupItem = None
]:
	i: 
	o: 733()

nname: 0
n 0(None)[from __future__ import absolute_import
from time import time
from .core import Menu
from peewee.debug import GET_LOGGER, PRINT_EXCEPTION
from peewee.notifier import Task
from peewee.system import get_free_available_space, get_space
from wynetwork.utils import WyNetwork
from pygui.config import plugins, user_config
from pygui.facilities.codemapping import hdmiresolution_dict
from pygui.facilities.l10n import get_date_format, get_time_format
from pygui.item.core import Item
from pygui.shared import pygui_globs
from pygui.eventmanager.menus import HorizontalNotebookMenuEventHandler, ParametersSubMenuEventHandler, SecretCodeMenuEventHandler
from pygui.item.parameters.generalsetup.securitysetup import SecretCodeUserConfigSetupItem, SecretCodeCheckConfigSetupItem
from pygui.item.parameters.videophoto.video import AspectRatioParametersSetupItem
from pygui.menu import UNIVERSE_NAME_DICT
from pygui.menu.menu.notebook import NotebookMenu, NotebookSubMenu
from peewee.messages import send as louie_send, connect as louie_connect, disconnect as louie_disconnect
log = GET_LOGGER(__name__)
_submenus_dict = {'generalsetup': (lambda : (GeneralConfigNotebookSubMenuParameters, dict(name=_('General'), type='notebook_setup_general'))), 'videophoto': (lambda : (GeneralNotebookSubMenuParameters, dict(name=_('Video/Photo'), type='notebook_setup_videophoto'))), 'connections': (lambda : (ConnectionsNotebookSubMenuParameters, dict(name=_('Connection'), type='notebook_setup_connections'))), 'network': (lambda : (NetworkNotebookSubMenuParameters, dict(name=_('General'), type='notebook_setup_network'))), 'advanced': (lambda : (AdvancedNotebookSubMenuParameters, dict(name=_('Advanced'), type='notebook_setup_advanced'))), 'version': (lambda : (VersionNotebookSubMenuParameters, dict(name=_('Version'), type='notebook_setup_version')))}
if 'tv' in plugins:
	def _submenus_dict['tv']():
		return (TVNotebookSubMenuParameters, dict(name=_('TV'), type='notebook_setup_tv'))

class MainSetupParametersNotebookMenu(NotebookMenu):
	universe = 'setup'
	lazy_selection_delay = 1
	def __init__(self, name, **kw):
		self.parameters_items = []
		self.parameters_menus = []
		self.parameters_args = []
		self.type = kw['type']
		self._root_getter()
		self.eventhandler = HorizontalNotebookMenuEventHandler(self)
		NotebookMenu.__init__(self, name=name, choices=self.parameters_items, submenus=self.parameters_menus, subargs=self.parameters_args, subpos=-2, **kw)
		self.set_items(self.parameters_items)
		self.refresh_network_task = Task(self._refresh_network)
		self.refresh_network_task.delay = 1
		self.refresh_network = self.refresh_network_task.start
		self.wn = WyNetwork()
		self.wn.wn_dev.attach(self)
		self.wn.wn_gen.attach(self)
		def _network_text():
			status = _('Disconnected')
			try:
				pass
			if self.wn.wn_gen.isConnected():
				for dev in self.wn.wn_dev.getDevices():
					dev_infos = self.wn.wn_dev.getDeviceInfos(dev)
					if dev_infos['active'] == 'true':
						if dev_infos['networkType'] == '802.11':
							pass
						status = _('Ethernet network')
						break
						continue

		def _network_icon():
			if self.wn.wn_gen.isConnected() and self.wn.wn_cfg.getActiveConfigurationInfos()['networkType'] != '802.3':
				return 'network_icon_wireless_selected.png'
			return 'network_icon_wired_selected.png'

		def _connection_text():
			if user_config['connections']['active_device'] == 'hdmi':
				current_connection = hdmiresolution_dict.get(user_config['connections']['resolution'], _('N/A'))
			else:
				current_connection = user_config['connections']['composite_output']
				current_connection = str(current_connection).upper()
			return current_connection

		self._getitems_keywords.update(dict(space_available=(lambda : _('%(size)s available space') % {'size': get_free_available_space('/wymedia')}), space_total=(lambda : _('%(size)s total space') % {'size': get_space('/wymedia')}), network=_network_text, network_icon=_network_icon, connection=_connection_text, universe_name=(lambda : UNIVERSE_NAME_DICT[self.type]), clock=(lambda : None)))
		louie_connect(self.connection_switched, 'connection_switched')

	def _root_getter(self):
		pass

	def refresh_connection(self, value):
		louie_send('connection', sender=self, value=value)

	def connection_switched(self, signal):
		self.refresh_connection(self['connection'])

	def _refresh_network(self):
		net_name = self['network']
		net_icon = self['network_icon']
		louie_send('network', sender=self, value=net_name)
		louie_send('network_icon', sender=self, value=net_icon)

	def on_modify_lang(self):
		stack = pygui_globs['menustack']

	def stop(self):
		self.wn.wn_gen.detach(self)
		louie_disconnect(self.connection_switched, 'connection_switched')
		NotebookMenu.stop(self)

	def onConnected(self):
		self.refresh_network()

	def onDisconnected(self):
		self.refresh_network()

	def onDeviceConnected(self, device):
		self.refresh_network()

	def onDeviceDisconnected(self, device):
		self.refresh_network()



class GeneralNotebookSubMenuParameters(NotebookSubMenu):
	__doc__ = "\n    Menu related to page 'General', 'Photo/Video', 'Connections'\n    "
	universe = 'setup'
	def __init__(self, browse_at_init=True, *args, **args):
		self.eventhandler = ParametersSubMenuEventHandler(self)
		NotebookSubMenu.__init__(self, *args, **kw)
		self.available_choices = ['main_list', 'center_list', 'options_list']
		self._getitems_keywords.update(dict(center_list=(lambda : self.get_item_list('center_list')), options_list=(lambda : self.get_item_list('options_list'))))
		if browse_at_init:
			self._browse_main()
		self.browse_selected_task = Task(self._browse_selected)
		self.browse_selected_task.delay = 0.5
		self.browse_selected = self.browse_selected_task.start

	def _set_main(self, value):
		item_list = self.get_item_list('main_list')
		item_list.select(value)

	def _get_main(self):
		item_list = self.get_item_list('main_list')
		if not item_list.selected:
			pass
		ret = item_list.selected
		return ret

	selected_main = property(_get_main, _set_main)
	del _get_main
	del _set_main
	def _set_center(self, value):
		item_list = self.get_item_list('center_list')
		item_list.select(value)

	def _get_center(self):
		item_list = self.get_item_list('center_list')
		if not item_list.selected:
			pass
		ret = item_list.selected
		return ret

	selected_center = property(_get_center, _set_center)
	del _get_center
	del _set_center
	def _set_options(self, value):
		item_list = self.get_item_list('options_list')
		item_list.select(value)

	def _get_options(self):
		item_list = self.get_item_list('options_list')
		if not item_list.selected:
			pass
		ret = item_list.selected
		return ret

	selected_options = property(_get_options, _set_options)
	del _get_options
	del _set_options
	def _browse_main(self):
		if not self.selected_main:
			pass
		item_top = self.selected_main
		if hasattr(item_top, 'depth'):
			if item_top.depth == 2:
				self.set_items([], 'center_list')
				self.set_items(item_top.browse(), 'options_list')
			if item_top.depth == 3:
				self.set_items(item_top.browse(), 'center_list')
				self._browse_center()
		else:
			self.set_items([], 'center_list')
			self.set_items([], 'options_list')

	def _browse_center(self):
		try:
			content = self.selected_center.browse()
		except AttributeError:
			log.debug('Center Item is not browseable')
			content = []
		self.set_items(content, 'options_list')

	def _browse_selected(self):
		switch = {'main_list': self._browse_main, 'center_list': self._browse_center}
		switch.get(self.active_list, (lambda : None))()

	def focus_next(self):
		if self.browse_selected_task.running:
			self.browse_selected_task.stop()
			self._browse_selected()
		if self.active_list == 'main_list' and not self['center_list']:
			log.debug('NEXT with center hop')
			self.active_list = 'options_list'
		else:
			log.debug('NEXT without center hop')
			Menu.focus_next(self)

	def focus_previous(self):
		if self.active_list == 'main_list':
			return False
		else:
			if self.active_list == 'options_list' and not self['center_list']:
				log.debug('PREV with center hop')
				self.active_list = 'main_list'
			else:
				Menu.focus_previous(self)

	def _set_options_list(self, selection, keep_selection=False):
		self.selected.display_type = 'checked'
		self.focus_previous()
		self.browse_selected()



class GeneralConfigNotebookSubMenuParameters(GeneralNotebookSubMenuParameters):
	def __init__(self, *args, **args):
		self.first_parental = False
		self._secret_code_launched = False
		GeneralNotebookSubMenuParameters.__init__(self, *args, **kw)

	def on_first_parental_control(self):
		user_config['security']['parental_control'] = False
		user_config.save()
		SecretCodeSetupParametersMenu(name='', verif_first=False).show()
		self._secret_code_launched = True

	def reload_func(self):
		if self._secret_code_launched and user_config['security']['secretcode'] is not None:
			self._secret_code_value = user_config['security']['secretcode']
			user_config['security']['secretcode'] = None
			user_config.save()
			def _set_parental_ok():
				user_config['security']['parental_control'] = True
				user_config['security']['secretcode'] = self._secret_code_value
				user_config.save()
				self.end_func()
				self.first_parental = False

			self._secret_code_launched = False
			QuestionAnswerSetupParametersLauncher(check=False, end_action=_set_parental_ok)
		return None



class ConnectionsNotebookSubMenuParameters(GeneralNotebookSubMenuParameters):
	def __init__(self, *args, **args):
		GeneralNotebookSubMenuParameters.__init__(self, browse_at_init=False, *args, **kw)
		self.available_choices = ['main_list', 'center_list', 'options_list', 'aspect_ratio_options_list']
		self._getitems_keywords.update(dict(aspect_ratio_options_list=(lambda : self.get_item_list('aspect_ratio_options_list'))))
		self._browse_main()

	def _browse_main(self):
		if isinstance(self.selected_main, AspectRatioParametersSetupItem):
			try:
				content = self.selected_main.browse()
			except AttributeError:
				log.debug('Center Item is not browseable')
				content = []
			self.set_items(content, 'aspect_ratio_options_list')
			self.set_items([], 'options_list')
		else:
			GeneralNotebookSubMenuParameters._browse_main(self)
			self.set_items([], 'aspect_ratio_options_list')

	def focus_next(self):
		if isinstance(self.selected_main, AspectRatioParametersSetupItem) and self.active_list == 'main_list':
			if self.browse_selected_task.running:
				self.browse_selected_task.stop()
				self._browse_selected()
			self.active_list = 'aspect_ratio_options_list'
		else:
			GeneralNotebookSubMenuParameters.focus_next(self)

	def focus_previous(self):
		if self.active_list == 'main_list':
			return False
		else:
			if self.active_list in ('options_list', 'aspect_ratio_options_list'):
				self.active_list = 'main_list'
			else:
				GeneralNotebookSubMenuParameters.focus_previous(self)

	def _set_options_list(self, selection, keep_selection=False):
		self.selected.display_type = 'checked'
		self.focus_previous()
		self.browse_selected()



class AdvancedNotebookSubMenuParameters(GeneralNotebookSubMenuParameters):
	def focus_next(self):
		from pygui.item.parameters.advanced.advancedsetup import ReInitBoxItem
		if isinstance(self.selected, ReInitBoxItem):
			return False
		else:
			GeneralNotebookSubMenuParameters.focus_next(self)



class VersionNotebookSubMenuParameters(NotebookSubMenu):
	universe = 'setup'
	def __init__(self, *args, **args):
		self.eventhandler = ParametersSubMenuEventHandler(self)
		NotebookSubMenu.__init__(self, *args, **kw)

	def focus_next(self):
		return False

	focus_previous = focus_next
	def browse_selected(self):
		return None



class NetworkNotebookSubMenuParameters(GeneralNotebookSubMenuParameters):
	def _browse_main(self):
		from pygui.item.parameters.network.networksetup import StatusNetworkConfSetupItem
		GeneralNotebookSubMenuParameters._browse_main(self)
		if isinstance(self.selected, StatusNetworkConfSetupItem):
			self['options_list'].selected = None
		return None

	def focus_previous(self):
		return False

	def focus_next(self):
		return False



class TVNotebookSubMenuParameters(GeneralNotebookSubMenuParameters):
	def __init__(self, *args, **args):
		GeneralNotebookSubMenuParameters.__init__(self, browse_at_init=False, *args, **kw)
		self.available_choices = ['main_list', 'center_list', 'options_list', 'options_auto_list']
		self._getitems_keywords.update(dict(options_auto_list=(lambda : self.get_item_list('options_auto_list'))))
		self._browse_main()

	def _browse_main(self):
		if isinstance(self.selected_main, TNTScanMenuSetupItem):
			try:
				content = self.selected_main.browse()
				louie_send('show_tv_button', sender=self)
			except AttributeError:
				log.debug('Center Item is not browseable')
				content = []
			self.set_items(content, 'options_auto_list')
			self.set_items([], 'options_list')
		else:
			GeneralNotebookSubMenuParameters._browse_main(self)
			self.set_items([], 'options_auto_list')
			louie_send('remove_tv_button', sender=self)

	def focus_previous(self):
		if self.active_list == 'main_list':
			return False
		else:
			if self.active_list in ('options_list', 'options_auto_list'):
				if not self['center_list']:
					log.debug('PREV with center hop')
					self.active_list = 'main_list'
				else:
					self.active_list = 'center_list'
			else:
				Menu.focus_previous(self)

	def focus_next(self):
		if isinstance(self.selected_main, TNTScanMenuSetupItem) and self.active_list == 'main_list':
			if self.browse_selected_task.running:
				self.browse_selected_task.stop()
				self._browse_selected()
			self.active_list = 'options_auto_list'
		else:
			GeneralNotebookSubMenuParameters.focus_next(self)

	def _set_options_list(self, selection, keep_selection=False):
		self.selected.display_type = 'checked'
		self.focus_previous()
		self.browse_selected()



from .security import SecretCodeCheckMenu, QuestionAnswerCheckLauncher, QuestionAnswerSetupParametersLauncher
class SecretCodeSetupParametersMenu(SecretCodeCheckMenu):
	__doc__ = '\n    This Menu adds new secret code capture capability to the SecretCodeCheckMenu.\n    This appends after checking that user knows the cuurent secret code\n    '
	def __init__(self, name, verif_first=True, eventhandler=None, **kw):
		SecretCodeCheckMenu.__init__(self, name, **kw)
		self.main_items.append(SecretCodeUserConfigSetupItem(name='SecretCode', menu=self, domain='security', key='secretcode'))
		self.prompt_items.append(Item(name=_('Enter your new code'), type_='unknown'))
		self._current_action = self.main_items[0]
		self._display_explain = False
		if not verif_first:
			self._display_explain = True
			self._good_verif()

	def _good_verif(self):
		self._browse_items(1)
		self._current_action = self.main_items[1]
		self.active_list = 'main_list'

	def _set_options_list(self, selection, keep_selection=False):
		if isinstance(selection, SecretCodeCheckConfigSetupItem):
			if selection.check_entered_value():
				self._good_verif()
			else:
				try:
					remain = self.countdown.pop()
				except IndexError:
					QuestionAnswerCheckLauncher(self._good_verif)
				else:
					self._browse_items(0)
					self.active_list = 'main_list'
		else:
			if self._display_explain:
				louie_send('secret_code_explain_off', sender=self)
			pygui_globs['menustack'].back_one_menu()

	def cancel(self):
		if self._current_action is self.main_items[0]:
			SecretCodeCheckMenu.cancel(self)

	def show(self, hide_previous_menu=False):
		SecretCodeCheckMenu.show(self, hide_previous_menu)
		if self._display_explain:
			louie_send('secret_code_explain_on', sender=self)



if 'tv' in plugins:
	from pygui.item.parameters.tv.tvsetup import TNTScanMenuSetupItem
else:
	TNTScanMenuSetupItem = None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xa170ccc>}
from __future__ import absolute_import
from time import time
from .core import Menu
from peewee.debug import GET_LOGGER, PRINT_EXCEPTION
from peewee.notifier import Task
from peewee.system import get_free_available_space, get_space
from wynetwork.utils import WyNetwork
from pygui.config import plugins, user_config
from pygui.facilities.codemapping import hdmiresolution_dict
from pygui.facilities.l10n import get_date_format, get_time_format
from pygui.item.core import Item
from pygui.shared import pygui_globs
from pygui.eventmanager.menus import HorizontalNotebookMenuEventHandler, ParametersSubMenuEventHandler, SecretCodeMenuEventHandler
from pygui.item.parameters.generalsetup.securitysetup import SecretCodeUserConfigSetupItem, SecretCodeCheckConfigSetupItem
from pygui.item.parameters.videophoto.video import AspectRatioParametersSetupItem
from pygui.menu import UNIVERSE_NAME_DICT
from pygui.menu.menu.notebook import NotebookMenu, NotebookSubMenu
from peewee.messages import send as louie_send, connect as louie_connect, disconnect as louie_disconnect
log = GET_LOGGER(__name__)
_submenus_dict = {'generalsetup': (lambda : (GeneralConfigNotebookSubMenuParameters, dict(name=_('General'), type='notebook_setup_general'))), 'videophoto': (lambda : (GeneralNotebookSubMenuParameters, dict(name=_('Video/Photo'), type='notebook_setup_videophoto'))), 'connections': (lambda : (ConnectionsNotebookSubMenuParameters, dict(name=_('Connection'), type='notebook_setup_connections'))), 'network': (lambda : (NetworkNotebookSubMenuParameters, dict(name=_('General'), type='notebook_setup_network'))), 'advanced': (lambda : (AdvancedNotebookSubMenuParameters, dict(name=_('Advanced'), type='notebook_setup_advanced'))), 'version': (lambda : (VersionNotebookSubMenuParameters, dict(name=_('Version'), type='notebook_setup_version')))}
if 'tv' in plugins:
	def _submenus_dict['tv']():
		return (TVNotebookSubMenuParameters, dict(name=_('TV'), type='notebook_setup_tv'))

class MainSetupParametersNotebookMenu(NotebookMenu):
	universe = 'setup'
	lazy_selection_delay = 1
	def __init__(self, name, **kw):
		self.parameters_items = []
		self.parameters_menus = []
		self.parameters_args = []
		self.type = kw['type']
		self._root_getter()
		self.eventhandler = HorizontalNotebookMenuEventHandler(self)
		NotebookMenu.__init__(self, name=name, choices=self.parameters_items, submenus=self.parameters_menus, subargs=self.parameters_args, subpos=-2, **kw)
		self.set_items(self.parameters_items)
		self.refresh_network_task = Task(self._refresh_network)
		self.refresh_network_task.delay = 1
		self.refresh_network = self.refresh_network_task.start
		self.wn = WyNetwork()
		self.wn.wn_dev.attach(self)
		self.wn.wn_gen.attach(self)
		def _network_text():
			status = _('Disconnected')
			try:
				pass
			if self.wn.wn_gen.isConnected():
				for dev in self.wn.wn_dev.getDevices():
					dev_infos = self.wn.wn_dev.getDeviceInfos(dev)
					if dev_infos['active'] == 'true':
						if dev_infos['networkType'] == '802.11':
							pass
						status = _('Ethernet network')
						break
						continue

		def _network_icon():
			if self.wn.wn_gen.isConnected() and self.wn.wn_cfg.getActiveConfigurationInfos()['networkType'] != '802.3':
				return 'network_icon_wireless_selected.png'
			return 'network_icon_wired_selected.png'

		def _connection_text():
			if user_config['connections']['active_device'] == 'hdmi':
				current_connection = hdmiresolution_dict.get(user_config['connections']['resolution'], _('N/A'))
			else:
				current_connection = user_config['connections']['composite_output']
				current_connection = str(current_connection).upper()
			return current_connection

		self._getitems_keywords.update(dict(space_available=(lambda : _('%(size)s available space') % {'size': get_free_available_space('/wymedia')}), space_total=(lambda : _('%(size)s total space') % {'size': get_space('/wymedia')}), network=_network_text, network_icon=_network_icon, connection=_connection_text, universe_name=(lambda : UNIVERSE_NAME_DICT[self.type]), clock=(lambda : None)))
		louie_connect(self.connection_switched, 'connection_switched')

	def _root_getter(self):
		pass

	def refresh_connection(self, value):
		louie_send('connection', sender=self, value=value)

	def connection_switched(self, signal):
		self.refresh_connection(self['connection'])

	def _refresh_network(self):
		net_name = self['network']
		net_icon = self['network_icon']
		louie_send('network', sender=self, value=net_name)
		louie_send('network_icon', sender=self, value=net_icon)

	def on_modify_lang(self):
		stack = pygui_globs['menustack']

	def stop(self):
		self.wn.wn_gen.detach(self)
		louie_disconnect(self.connection_switched, 'connection_switched')
		NotebookMenu.stop(self)

	def onConnected(self):
		self.refresh_network()

	def onDisconnected(self):
		self.refresh_network()

	def onDeviceConnected(self, device):
		self.refresh_network()

	def onDeviceDisconnected(self, device):
		self.refresh_network()



class GeneralNotebookSubMenuParameters(NotebookSubMenu):
	__doc__ = "\n    Menu related to page 'General', 'Photo/Video', 'Connections'\n    "
	universe = 'setup'
	def __init__(self, browse_at_init=True, *args, **args):
		self.eventhandler = ParametersSubMenuEventHandler(self)
		NotebookSubMenu.__init__(self, *args, **kw)
		self.available_choices = ['main_list', 'center_list', 'options_list']
		self._getitems_keywords.update(dict(center_list=(lambda : self.get_item_list('center_list')), options_list=(lambda : self.get_item_list('options_list'))))
		if browse_at_init:
			self._browse_main()
		self.browse_selected_task = Task(self._browse_selected)
		self.browse_selected_task.delay = 0.5
		self.browse_selected = self.browse_selected_task.start

	def _set_main(self, value):
		item_list = self.get_item_list('main_list')
		item_list.select(value)

	def _get_main(self):
		item_list = self.get_item_list('main_list')
		if not item_list.selected:
			pass
		ret = item_list.selected
		return ret

	selected_main = property(_get_main, _set_main)
	del _get_main
	del _set_main
	def _set_center(self, value):
		item_list = self.get_item_list('center_list')
		item_list.select(value)

	def _get_center(self):
		item_list = self.get_item_list('center_list')
		if not item_list.selected:
			pass
		ret = item_list.selected
		return ret

	selected_center = property(_get_center, _set_center)
	del _get_center
	del _set_center
	def _set_options(self, value):
		item_list = self.get_item_list('options_list')
		item_list.select(value)

	def _get_options(self):
		item_list = self.get_item_list('options_list')
		if not item_list.selected:
			pass
		ret = item_list.selected
		return ret

	selected_options = property(_get_options, _set_options)
	del _get_options
	del _set_options
	def _browse_main(self):
		if not self.selected_main:
			pass
		item_top = self.selected_main
		if hasattr(item_top, 'depth'):
			if item_top.depth == 2:
				self.set_items([], 'center_list')
				self.set_items(item_top.browse(), 'options_list')
			if item_top.depth == 3:
				self.set_items(item_top.browse(), 'center_list')
				self._browse_center()
		else:
			self.set_items([], 'center_list')
			self.set_items([], 'options_list')

	def _browse_center(self):
		try:
			content = self.selected_center.browse()
		except AttributeError:
			log.debug('Center Item is not browseable')
			content = []
		self.set_items(content, 'options_list')

	def _browse_selected(self):
		switch = {'main_list': self._browse_main, 'center_list': self._browse_center}
		switch.get(self.active_list, (lambda : None))()

	def focus_next(self):
		if self.browse_selected_task.running:
			self.browse_selected_task.stop()
			self._browse_selected()
		if self.active_list == 'main_list' and not self['center_list']:
			log.debug('NEXT with center hop')
			self.active_list = 'options_list'
		else:
			log.debug('NEXT without center hop')
			Menu.focus_next(self)

	def focus_previous(self):
		if self.active_list == 'main_list':
			return False
		else:
			if self.active_list == 'options_list' and not self['center_list']:
				log.debug('PREV with center hop')
				self.active_list = 'main_list'
			else:
				Menu.focus_previous(self)

	def _set_options_list(self, selection, keep_selection=False):
		self.selected.display_type = 'checked'
		self.focus_previous()
		self.browse_selected()



class GeneralConfigNotebookSubMenuParameters(GeneralNotebookSubMenuParameters):
	def __init__(self, *args, **args):
		self.first_parental = False
		self._secret_code_launched = False
		GeneralNotebookSubMenuParameters.__init__(self, *args, **kw)

	def on_first_parental_control(self):
		user_config['security']['parental_control'] = False
		user_config.save()
		SecretCodeSetupParametersMenu(name='', verif_first=False).show()
		self._secret_code_launched = True

	def reload_func(self):
		if self._secret_code_launched and user_config['security']['secretcode'] is not None:
			self._secret_code_value = user_config['security']['secretcode']
			user_config['security']['secretcode'] = None
			user_config.save()
			def _set_parental_ok():
				user_config['security']['parental_control'] = True
				user_config['security']['secretcode'] = self._secret_code_value
				user_config.save()
				self.end_func()
				self.first_parental = False

			self._secret_code_launched = False
			QuestionAnswerSetupParametersLauncher(check=False, end_action=_set_parental_ok)
		return None



class ConnectionsNotebookSubMenuParameters(GeneralNotebookSubMenuParameters):
	def __init__(self, *args, **args):
		GeneralNotebookSubMenuParameters.__init__(self, browse_at_init=False, *args, **kw)
		self.available_choices = ['main_list', 'center_list', 'options_list', 'aspect_ratio_options_list']
		self._getitems_keywords.update(dict(aspect_ratio_options_list=(lambda : self.get_item_list('aspect_ratio_options_list'))))
		self._browse_main()

	def _browse_main(self):
		if isinstance(self.selected_main, AspectRatioParametersSetupItem):
			try:
				content = self.selected_main.browse()
			except AttributeError:
				log.debug('Center Item is not browseable')
				content = []
			self.set_items(content, 'aspect_ratio_options_list')
			self.set_items([], 'options_list')
		else:
			GeneralNotebookSubMenuParameters._browse_main(self)
			self.set_items([], 'aspect_ratio_options_list')

	def focus_next(self):
		if isinstance(self.selected_main, AspectRatioParametersSetupItem) and self.active_list == 'main_list':
			if self.browse_selected_task.running:
				self.browse_selected_task.stop()
				self._browse_selected()
			self.active_list = 'aspect_ratio_options_list'
		else:
			GeneralNotebookSubMenuParameters.focus_next(self)

	def focus_previous(self):
		if self.active_list == 'main_list':
			return False
		else:
			if self.active_list in ('options_list', 'aspect_ratio_options_list'):
				self.active_list = 'main_list'
			else:
				GeneralNotebookSubMenuParameters.focus_previous(self)

	def _set_options_list(self, selection, keep_selection=False):
		self.selected.display_type = 'checked'
		self.focus_previous()
		self.browse_selected()



class AdvancedNotebookSubMenuParameters(GeneralNotebookSubMenuParameters):
	def focus_next(self):
		from pygui.item.parameters.advanced.advancedsetup import ReInitBoxItem
		if isinstance(self.selected, ReInitBoxItem):
			return False
		else:
			GeneralNotebookSubMenuParameters.focus_next(self)



class VersionNotebookSubMenuParameters(NotebookSubMenu):
	universe = 'setup'
	def __init__(self, *args, **args):
		self.eventhandler = ParametersSubMenuEventHandler(self)
		NotebookSubMenu.__init__(self, *args, **kw)

	def focus_next(self):
		return False

	focus_previous = focus_next
	def browse_selected(self):
		return None



class NetworkNotebookSubMenuParameters(GeneralNotebookSubMenuParameters):
	def _browse_main(self):
		from pygui.item.parameters.network.networksetup import StatusNetworkConfSetupItem
		GeneralNotebookSubMenuParameters._browse_main(self)
		if isinstance(self.selected, StatusNetworkConfSetupItem):
			self['options_list'].selected = None
		return None

	def focus_previous(self):
		return False

	def focus_next(self):
		return False



class TVNotebookSubMenuParameters(GeneralNotebookSubMenuParameters):
	def __init__(self, *args, **args):
		GeneralNotebookSubMenuParameters.__init__(self, browse_at_init=False, *args, **kw)
		self.available_choices = ['main_list', 'center_list', 'options_list', 'options_auto_list']
		self._getitems_keywords.update(dict(options_auto_list=(lambda : self.get_item_list('options_auto_list'))))
		self._browse_main()

	def _browse_main(self):
		if isinstance(self.selected_main, TNTScanMenuSetupItem):
			try:
				content = self.selected_main.browse()
				louie_send('show_tv_button', sender=self)
			except AttributeError:
				log.debug('Center Item is not browseable')
				content = []
			self.set_items(content, 'options_auto_list')
			self.set_items([], 'options_list')
		else:
			GeneralNotebookSubMenuParameters._browse_main(self)
			self.set_items([], 'options_auto_list')
			louie_send('remove_tv_button', sender=self)

	def focus_previous(self):
		if self.active_list == 'main_list':
			return False
		else:
			if self.active_list in ('options_list', 'options_auto_list'):
				if not self['center_list']:
					log.debug('PREV with center hop')
					self.active_list = 'main_list'
				else:
					self.active_list = 'center_list'
			else:
				Menu.focus_previous(self)

	def focus_next(self):
		if isinstance(self.selected_main, TNTScanMenuSetupItem) and self.active_list == 'main_list':
			if self.browse_selected_task.running:
				self.browse_selected_task.stop()
				self._browse_selected()
			self.active_list = 'options_auto_list'
		else:
			GeneralNotebookSubMenuParameters.focus_next(self)

	def _set_options_list(self, selection, keep_selection=False):
		self.selected.display_type = 'checked'
		self.focus_previous()
		self.browse_selected()



from .security import SecretCodeCheckMenu, QuestionAnswerCheckLauncher, QuestionAnswerSetupParametersLauncher
class SecretCodeSetupParametersMenu(SecretCodeCheckMenu):
	__doc__ = '\n    This Menu adds new secret code capture capability to the SecretCodeCheckMenu.\n    This appends after checking that user knows the cuurent secret code\n    '
	def __init__(self, name, verif_first=True, eventhandler=None, **kw):
		SecretCodeCheckMenu.__init__(self, name, **kw)
		self.main_items.append(SecretCodeUserConfigSetupItem(name='SecretCode', menu=self, domain='security', key='secretcode'))
		self.prompt_items.append(Item(name=_('Enter your new code'), type_='unknown'))
		self._current_action = self.main_items[0]
		self._display_explain = False
		if not verif_first:
			self._display_explain = True
			self._good_verif()

	def _good_verif(self):
		self._browse_items(1)
		self._current_action = self.main_items[1]
		self.active_list = 'main_list'

	def _set_options_list(self, selection, keep_selection=False):
		if isinstance(selection, SecretCodeCheckConfigSetupItem):
			if selection.check_entered_value():
				self._good_verif()
			else:
				try:
					remain = self.countdown.pop()
				except IndexError:
					QuestionAnswerCheckLauncher(self._good_verif)
				else:
					self._browse_items(0)
					self.active_list = 'main_list'
		else:
			if self._display_explain:
				louie_send('secret_code_explain_off', sender=self)
			pygui_globs['menustack'].back_one_menu()

	def cancel(self):
		if self._current_action is self.main_items[0]:
			SecretCodeCheckMenu.cancel(self)

	def show(self, hide_previous_menu=False):
		SecretCodeCheckMenu.show(self, hide_previous_menu)
		if self._display_explain:
			louie_send('secret_code_explain_on', sender=self)



if 'tv' in plugins:
	from pygui.item.parameters.tv.tvsetup import TNTScanMenuSetupItem
else:
	TNTScanMenuSetupItem = None
